Stryker jest-runner
fails with jest prerelease versions above v27 when coverageAnalysis
is set to "perTest"
#5015
Labels
🐛 Bug
Something isn't working
Summary
Stryker
jest-runner
crashes withCannot read properties of undefined (reading 'getEnv')
at this linestryker-js/packages/jest-runner/src/jest-plugins/jasmine2-setup-coverage-analysis.cts
Line 2 in 2faded7
"testRunner": "jest",
"coverageAnalysis": "perTest"` when running with a jest prerelease version (e.g. latest jest prerelease version at the time is 30.0.0-alpha.6.The bug is triggered when
coverageAnalysis
is set toperTest
as that invokeswithCoverageAnalysis
that in turn usessemver
package to test the jest current version and checks if its >= 27. This check fails when using a prerelease version:Stryker config
Relevant config options to trigger the bug are
"testRunner": "jest"
and"coverageAnalysis": "perTest"
withCoverageAnalysis
that in turn checks the jest version to set some configuration options. The version check doesn't coerce prerelease versions so the else branch is taken here for jest version 30.0.0-alpha.6.Test runner config
No relevant
Stryker environment
Test runner environment
Not relevant
Your Environment
Not relevant
The text was updated successfully, but these errors were encountered: