-
Notifications
You must be signed in to change notification settings - Fork 5
CRA You need Jest version >= 22.0.0 to use Stryker error #49
Comments
Hi @protosimon, thanks for taking the time to report this. Can you please do an |
@mthmulders, I am using jest@20.0.4 that's pulled down by react-scripts. |
Thanks! Didn't know they had v20. I'm using the TypeScript-flavour of CRA, which has v22. |
I guess not: We've overlooked this. @mthmulders how much work would it be to also support v20? |
Oh, CRA has a We had a good reason to bump Jest to 20: Jest #5401 was biting us when we tried to run Jest from Stryker. I have no clue what it would take to downgrade Jest back to 22, since the general remark seems to be to "just upgrade Jest" :-( |
You might try to use |
I'm no react expert, but can't @protosimon just install a new version of Jest? Sure he would have 2 jest versions in his node_modules (one |
Since he's using CRA, I think he cannot. Quoting @gaearon in facebook/jest #5119:
|
The way I see it, your not upgrading the It seems to work for me: npx create-react-app my-app
cd my-app
npm i -D jest@22
npm ls | grep jest
# ... outputs:
+-- jest@22.4.3
# ...
+-- jest@20.0.4
# ...
stryker init
# < choose jest, no transpilers >
vi stryker.conf.js
# < change some things: mutate array (only mutate App.js), disable coverage analysis >
stryker run
[2018-05-17 09:55:58.040] [INFO] ConfigReader - Using stryker.conf.js in the current working directory.
[2018-05-17 09:55:58.384] [INFO] InputFileResolver - Found 1 of 15 file(s) to be mutated.
[2018-05-17 09:55:58.389] [INFO] InitialTestExecutor - Starting initial test run. This may take a while.
[2018-05-17 09:56:03.485] [INFO] InitialTestExecutor - Initial test run succeeded. Ran 1 tests in 5 seconds.
[2018-05-17 09:56:03.523] [INFO] Stryker - 1 Mutant(s) generated
[2018-05-17 09:56:03.527] [INFO] SandboxPool - Creating 8 test runners (based on CPU count)
Mutation testing [==================================================] 100% (ETC 0.0s) 1/1 tested (0 survived)
Ran 0.00 tests per mutant on average.
----------|---------|----------|-----------|------------|----------|---------|
File | % score | # killed | # timeout | # survived | # no cov | # error |
----------|---------|----------|-----------|------------|----------|---------|
All files | 100.00 | 0 | 1 | 0 | 0 | 0 |
App.js | 100.00 | 0 | 1 | 0 | 0 | 0 |
----------|---------|----------|-----------|------------|----------|---------|
[2018-05-17 09:56:18.815] [INFO] Stryker - Done in 20 seconds.
... @protosimon could you give it a go? |
Closing it for now. Please comment again when you still have problems. |
First of all, I am elated to find a mutation test framework for JS. I come from a quick check and PIT testing background and place a high value on the quality of tests. I am trying to configure stryker with my CRA project and getting the following error even-though the peer dependencies are met. An entry in the CRA docs on how to configure stryker would be great for devs and growing the community.
stryker.conf.js
I have the following dependencies and jest config in package.json
The text was updated successfully, but these errors were encountered: