stryker-js icon indicating copy to clipboard operation
stryker-js copied to clipboard

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

Open nicojs opened this issue 5 years ago • 5 comments

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.

nicojs avatar Jul 10 '20 09:07 nicojs

Ran into this problem myself and this fixed worked !!

ChrisWillcock avatar Jul 10 '20 10:07 ChrisWillcock

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;

bartekleon avatar Jul 11 '20 09:07 bartekleon

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.

stale[bot] avatar Jul 11 '21 11:07 stale[bot]

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.

nicojs avatar Jul 13 '21 11:07 nicojs

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.

stale[bot] avatar Jul 13 '22 16:07 stale[bot]