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

jest-runner is not working with even a simple project #2071

Closed
tylermurry opened this issue Mar 3, 2020 · 3 comments
Closed

jest-runner is not working with even a simple project #2071

tylermurry opened this issue Mar 3, 2020 · 3 comments
Labels
🐛 Bug Something isn't working

Comments

@tylermurry
Copy link

tylermurry commented Mar 3, 2020

Summary

I am trying to include Stryker into a project that uses Jest, but I'm running up against problems with even the simplest of projects. To demonstrate this, I have created a dead-simple node project that uses Jest and generates the following issue:

11:12:27 (16352) INFO ConfigReader Using stryker.conf.js in the current working directory.
11:12:28 (16352) WARN InputFileResolver No files marked to be mutated, Stryker will perform a dry-run without actually mutating anything. You can configure the `mutate` property in your stryker.conf.js file (or use `--mutate` via command line).
11:12:28 (16352) INFO InitialTestExecutor Starting initial test run. This may take a while.
11:12:31 (16352) WARN Sandbox Could not symlink "/Users/dev/stryker-test/node_modules" in sandbox directory, it is already created in the sandbox. Please remove the node_modules from your sandbox files. Alternatively, set `symlinkNodeModules` to `false` to disable this warning.
11:12:36 (16352) ERROR InitialTestExecutor One or more tests resulted in an error:
        Test runner crashed. Tried twice to restart it without any luck. Last time the error message was: Error: TypeError: Cannot read property 'runCLI' of undefined
TypeError: Cannot read property 'runCLI' of undefined
    at JestPromiseTestAdapter.run (/Users/dev/stryker-test/node_modules/@stryker-mutator/jest-runner/src/jestTestAdapters/JestPromiseTestAdapter.js:17:31)
    at JestTestRunner.run (/Users/dev/stryker-test/node_modules/@stryker-mutator/jest-runner/src/JestTestRunner.js:43:56)
    at ChildProcessTestRunnerWorker.run (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/test-runner/ChildProcessTestRunnerWorker.js:24:56)
    at ChildProcessProxyWorker.doCall (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:75:56)
    at resolve (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:46:53)
    at new Promise (<anonymous>)
    at ChildProcessProxyWorker.handleMessage (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:46:17)
    at process.emit (events.js:198:13)
    at emit (internal/child_process.js:832:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Error: TypeError: Cannot read property 'runCLI' of undefined
TypeError: Cannot read property 'runCLI' of undefined
    at JestPromiseTestAdapter.run (/Users/dev/stryker-test/node_modules/@stryker-mutator/jest-runner/src/jestTestAdapters/JestPromiseTestAdapter.js:17:31)
    at JestTestRunner.run (/Users/dev/stryker-test/node_modules/@stryker-mutator/jest-runner/src/JestTestRunner.js:43:56)
    at ChildProcessTestRunnerWorker.run (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/test-runner/ChildProcessTestRunnerWorker.js:24:56)
    at ChildProcessProxyWorker.doCall (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:75:56)
    at resolve (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:46:53)
    at new Promise (<anonymous>)
    at ChildProcessProxyWorker.handleMessage (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:46:17)
    at process.emit (events.js:198:13)
    at emit (internal/child_process.js:832:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at ChildProcess.worker.on (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxy.js:133:68)
    at ChildProcess.emit (events.js:198:13)
    at emit (internal/child_process.js:832:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
11:12:36 (16352) ERROR StrykerCli an error occurred Error: Something went wrong in the initial test run
    at InitialTestExecutor.validateResult (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/process/InitialTestExecutor.js:86:15)
    at InitialTestExecutor.run (/Users/dev/stryker-test/node_modules/@stryker-mutator/core/src/process/InitialTestExecutor.js:41:14)
    at process._tickCallback (internal/process/next_tick.js:68:7)
11:12:36 (16352) INFO StrykerCli Trouble figuring out what went wrong? Try `npx stryker run --fileLogLevel trace --logLevel debug` to get some more info.

Stryker config

module.exports = function(config) {
  config.set({
    mutator: "javascript",
    packageManager: "npm",
    reporters: ["clear-text", "progress"],
    testRunner: "jest",
    transpilers: [],
    coverageAnalysis: "off"
  });
};

Test runner config

None

Stryker environment

├─┬ @stryker-mutator/core@2.5.0
│ ├─┬ @stryker-mutator/api@2.5.0
│ ├── @stryker-mutator/util@2.5.0
├─┬ @stryker-mutator/javascript-mutator@2.5.0
│ ├── @stryker-mutator/api@2.5.0 deduped
├─┬ @stryker-mutator/jest-runner@2.5.0
│ ├── @stryker-mutator/api@2.5.0 deduped
+-- jest@25.1.0

Test runner environment

npm test

Your Environment

software version(s)
node 10.16.1
npm 6.14.1
Operating System MacOS 10.14.5

Add stryker.log

stryker.log

@tylermurry tylermurry added the 🐛 Bug Something isn't working label Mar 3, 2020
@simondel
Copy link
Member

simondel commented Mar 3, 2020

Hi! This seems to be a duplicate of #1983

Support for Jest 25 will be released with v3 of Stryker. For now, please downgrade to Jest 24 or wait for v3 of Stryker, sorry!

@simondel simondel closed this as completed Mar 3, 2020
@simondel
Copy link
Member

Hi! Jest 25 support has been released with @stryker-mutator version 3! You can read all about it here: https://stryker-mutator.io/blog/2020-03-11/stryker-version-3

@statefull
Copy link

statefull commented Sep 16, 2020

Still not working with Jest version > 24. I was using jest version 26 I need to downgrade to version 24 to get it working. Stricker version 3.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants