Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stryker fails when Jest has it.skip() tests #1152

Closed
Chowarmaan opened this issue Sep 20, 2018 · 3 comments
Closed

Stryker fails when Jest has it.skip() tests #1152

Chowarmaan opened this issue Sep 20, 2018 · 3 comments
Assignees

Comments

@Chowarmaan
Copy link

Summary

In my test suite, I have a test that is marked to be skipped using the it.skip() syntax. When Stryker is analyzing this test, it determines that the test had initial test failures, where the skipped tests are not failures, but should be ignored.

10:43:06 (17232) ERROR InitialTestExecutor One or more tests failed in the initial test run:
        Test the root path It should response the GET method
10:43:06 (17232) ERROR StrykerCli an error occurred Error: There were failed tests in the initial test run.
    at InitialTestExecutor.validateResult (C:\Users\stevens\Development\TestScripts\Emulator\node_modules\stryker\src\process\InitialTestExecutor.js:108:27)
    at InitialTestExecutor.<anonymous> (C:\Users\stevens\Development\TestScripts\Emulator\node_modules\stryker\src\process\InitialTestExecutor.js:45:30)
    at step (C:\Users\stevens\Development\TestScripts\Emulator\node_modules\tslib\tslib.js:133:27)
    at Object.next (C:\Users\stevens\Development\TestScripts\Emulator\node_modules\tslib\tslib.js:114:57)
    at fulfilled (C:\Users\stevens\Development\TestScripts\Emulator\node_modules\tslib\tslib.js:104:62)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Stryker config

module.exports = function (config) {
	config.set({
		coverageAnalysis: "off",
		htmlReporter: {
			baseDir: 'docs/mutation'
		},
		jest: {
			config: require('./jest.config.js'),
			projectType: 'custom'
		},
		loglevel: "debug",
		mutate: [
			'src/**/*.ts',
			'!src/**/*.spec.ts'
		],
		mutator: {
			name: "typescript",
			excludedMutations: []
		},
		packageManager: "npm",
		reporters: ["html", "progress"],
		testRunner: "jest",
		transpilers: [],
		tsconfigFile: "tsconfig.json"
	});
};

Stryker environment

Your Environment

software version(s)
node 10.10.0
npm 6.4.1
Operating System Windows 10

Add stryker.log

stryker.log

@sanderkoenders
Copy link
Member

sanderkoenders commented Oct 2, 2018

Do you have a repository to reproduce this issue by any chance. That'll help us to more easily troubleshoot the situation.

@Chowarmaan
Copy link
Author

Chowarmaan commented Oct 2, 2018 via email

@sanderkoenders
Copy link
Member

I was able to reproduce this issue with some random jest project I found online. I'll fix it tonight.

@ghost ghost assigned sanderkoenders Oct 2, 2018
simondel pushed a commit that referenced this issue Oct 3, 2018
Implement `TestStatus.Skipped` for pending jest results so Stryker does not fail on the first testrun when tests are marked as `skip`

Fixes #1152
@ghost ghost removed the 🔎 Needs review label Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants