stryker-mutator / stryker-jest-runner

A plugin to use the Jest test runner and framework in Stryker, the JavaScript mutation testing framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jest v20 is not supported

nicojs opened this issue · comments

When running stryker with jest@20 i get this error:

$ stryker run
[2017-08-10 18:49:25.840] [INFO] ConfigReader - Using stryker.conf.js in the current working directory.
[2017-08-10 18:49:26.015] [INFO] InputFileResolver - Found 1 of 2 file(s) to be mutated.
[2017-08-10 18:49:26.016] [INFO] SandboxCoordinator - Starting initial test run. This may take a while.
[2017-08-10 18:49:26.685] [ERROR] IsolatedTestRunnerAdapter - (node:17004) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Runtime.createHasteContext is not a function

[2017-08-10 18:49:26.685] [ERROR] IsolatedTestRunnerAdapter - (node:17004) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Reproduce:

git clone git@github.com:nicojs/mutant-testing.git
cd mutant-testing
npm i
npm run stryker

Seems Jest v19 is working out of the box, whereas v20 is not. Seeing the changelog for v20, it's no surprise it breaks here. I'll take a look!

Great, thanks!

Change logs don't include changes to private apis. Maybe we can find the time to present our solution to be promoted as a public api? Or they can help us accomplish the same things using public apis?

@Fenntasy, thanks for the report and the nice reproduction repo. Made it pretty easy to pinpoint what's going on :). A fix is on it's way!

As an aside: I noticed in your repo that you have coverageAnalysis set to 'perTest'. Note that the Jest runner currently doesn't support coverage analysis. If you do configure Stryker to work with coverage analysis, I'm pretty sure it will break somewhere since the Jest runner doesn't properly export the expected data.

Fixed in v0.1.0. Thanks again for the report!