stryker-mutator / stryker-js

Mutation testing for JavaScript and friends
https://stryker-mutator.io
Apache License 2.0
2.58k stars 249 forks source link

Default tempDir to `stryker-tmp` instead of `.stryker-tmp` for jest runner #2307

Closed nicojs closed 2 years ago

nicojs commented 4 years ago

Is your feature request related to a problem? Please describe. Jest doesn't handle hidden directories well. See #2122. A valid workaround is to not load jest in a hidden directory (https://github.com/stryker-mutator/stryker/issues/2122#issuecomment-605783668)

Describe the solution you'd like On stryker init override tempDir when jest runner is chosen.

Describe alternatives you've considered Waiting for jest to fix https://github.com/facebook/jest/issues/9728 but it might take some time.

Additional context This is broken since Jest 25. More and more people are migrating to 25, so this workaround is valid.

We could also change the default dir to not be a hidden dir. But I personally like it to be a hidden dir, so it won't clog up the file explorer.

ChrisWillcock commented 4 years ago

Ran into this problem myself and this fixed worked !!

bartekleon commented 4 years ago

We could make a check, what version of Jest is currently used and based on that determine if . can be on the first character or not. Like,

config.tempDir = jest.version.startsWith('25') && config.tempDir.startsWith('.') ? config.tempDir.substring(1) : config.tempDir;
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

nicojs commented 3 years ago

Since https://github.com/facebook/jest/issues/9728 is now closed, we can update to the latest jest to verify that the underlying issue is solved. Let's try it out.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.