Skip to content
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

fix: jest prerelease support (#5015) #5016

Merged
merged 4 commits into from
Sep 29, 2024
Merged

Conversation

rriski
Copy link
Contributor

@rriski rriski commented Sep 17, 2024

Previously, stryker failed jasmine2-setup-coverage-analysis.cts

runTest ... node_modules/jest-runner/build/index.js:340:7), Cannot read
properties of undefined (reading 'getEnv') TypeError: Cannot read properties
of undefined (reading 'getEnv')

When using the latest jest prerelease version (30.0.0-alpha.6)

This commit fixes the error by using semver.coerce:

> semver.satisfies('30.0.0-alpha.6', '>=27')
false
> semver.satisfies(semver.coerce('30.0.0-alpha.6'), '>=27')
true

Previously, stryker failed `jasmine2-setup-coverage-analysis.cts`

    runTest ... node_modules/jest-runner/build/index.js:340:7), Cannot read
    properties of undefined (reading 'getEnv') TypeError: Cannot read properties
    of undefined (reading 'getEnv')

When using the latest jest prerelease version (30.0.0-alpha.6)

This commit fixes the error by using `semver.coerce`:

    > semver.satisfies('30.0.0-alpha.6', '>=27')
    false
    > semver.satisfies(semver.coerce('30.0.0-alpha.6'), '>=27')
    true
Copy link
Member

@nicojs nicojs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I didn't know about coerce.

@nicojs
Copy link
Member

nicojs commented Sep 29, 2024

I've added some unit tests and fixed the type errors.

@nicojs nicojs enabled auto-merge (squash) September 29, 2024 18:52
@nicojs nicojs merged commit 0c9cdd1 into stryker-mutator:master Sep 29, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants