stryker-mutator / stryker-js

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

Does this project support nx workspaces? #3984

Open mcmxcdev opened 1 year ago

mcmxcdev commented 1 year ago

Question

We use https://nx.dev/ for our monorepo and there are multiple levels of jest.config.ts. To be able to run mutation test, we need to point to the jest config of a nested app.

Ideally, we would like to just point at the root jest config and let stryker discover the nested jest configs and apply the correct settings needed for each package (nextjs, nestjs, libs etc).

Right now if we point to the root jest config and try to run the tests for a nested nextjs package, we run into Support for the experimental syntax 'jsx' isn't currently enabled

Stryker environment

"@stryker-mutator/api": "^6.3.1",
"@stryker-mutator/core": "^6.3.1",
"@stryker-mutator/jest-runner": "^6.3.1",
"@stryker-mutator/typescript-checker": "^6.3.1",
nicojs commented 1 year ago

Do you mean a multi-project setup? We have a documented known issue for that: https://stryker-mutator.io/docs/stryker-js/troubleshooting/#jest-crashes-with-a-multi-project-configuration

Reading through the issue in jest, we should be able to make it work. Could you contribute a minimal setup that reproduces the issue? A .zip file attached here is fine, or a github repo you want to link.

vinylhero commented 1 year ago

Hey, I've also just stumbled into Stryker. It seems like a great addition we could add to our project. We're using NX, Jest, Typescript, Angular, and we're also building libs that we'd like to cover off with mutation testing. Adding a comment here to keep track of NX and Stryker support.

I've attempted to get Stryker working on just one lib but I keep running into walls that I think are related to the project setup.

nicojs commented 1 year ago

@vinylhero could you maybe provide a minimal reproduction project?

stale[bot] commented 8 months 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.