-
Notifications
You must be signed in to change notification settings - Fork 251
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 custom params #2155
Comments
Thanks for opening this issue! The Because you passed it to your regular test command, Stryker won't know about it. Unfortunately, even if you'd set in your config, Stryker will override it. This is quite silly because I believe that you should set your env in your Jest config because it seems like What do you think of this? There are some things that I want to change:
As a temporary workaround while we fix this, you could use the command test runner by not setting the note: your |
Hi, thanks for your answer ! If I understand, when I set
An other problem maybe linked with that is my env variables in I fixed it with the following command Maybe you can always use a custom command line ( I tried to remove jest
|
Indeed, when you specify a I just checked the react-test docs and they automatically try to figure out if you're running on your local machine or on a CI server. You can manually set this by setting the env variable Could you check what happens when you se the |
You could also pass |
@simondel Ok it's that ! I'll launch it in my CI to test |
I don't know if it's OK or not but it ran only 1 test. And all tests timeout
|
That's ok. Since the command test runner has no idea what command you're running it just reports one test. We may have to change that so it just says Could you try to increase the timeout using the stryker config:
Jest can take a while to get started on some applications when running in parallel (more info on timeouts: https://www.npmjs.com/package/@stryker-mutator/core#timeoutfactor--number-) |
@simondel not better :/ |
* Adds support for overriding config in your package.json/jest.config.js and/or react-scripts node_modules. * Added config setting `jest.configFile` to specify a path to your config file. This file will be loaded using `require` * The `jest.config` setting now works together with `jest.configFile` to allow you to override the config in your `configFile` Fixes #2155
Hello,
I'm trying to test an create-react-app application with jest and stryker.
I have errors durings the initial tests of stryker because parameters added to my jest command line are not taken.
The test script in my package.json:
"test": "react-scripts test --env=jest-environment-jsdom-sixteen --verbose"
And the stryker script
"test:stryker": "stryker run"
The main problem is beacause my tests need jsdom-sixteen. Without I have the following error:
TypeError: MutationObserver is not a constructor
I give the param via command line because create-react-app doesn't accept overriding it directly.
Stryker config
Stryker environment
The text was updated successfully, but these errors were encountered: