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

Support for pnpm as a package manager #3221

Closed
VVKot opened this issue Oct 24, 2021 · 4 comments · Fixed by #3802
Closed

Support for pnpm as a package manager #3221

VVKot opened this issue Oct 24, 2021 · 4 comments · Fixed by #3802
Labels
🚀 Feature request New feature request hacktoberfest https://hacktoberfest.digitalocean.com/

Comments

@VVKot
Copy link

VVKot commented Oct 24, 2021

Is your feature request related to a problem? Please describe.
Sadly stryker does not fully work with https://pnpm.io/

Describe the solution you'd like
All features are appropriately supported.

Describe alternatives you've considered
Sadly the only alternative would be switching package managers, which is not an option in my case.

Additional context
Specifically, https://stryker-mutator.io/docs/stryker-js/typescript-checker does not work with pnpm - stryker is not able to find/load it when installed with pnpm. Without it I likely won't be able to use stryker - lots of mutants are not type safe, and I'd like to filter them out before running tests. If that's not done, mutation testing would literally take hours.

@VVKot VVKot added the 🚀 Feature request New feature request label Oct 24, 2021
@nicojs
Copy link
Member

nicojs commented Oct 25, 2021

Hi @VVKot 🙋‍♀️

I haven't used pnpm myself, but on the website I read this:

Files inside node_modules are linked from a single content-addressable storage

I think this is messing up the plugin discovery. Could you try to override plugins in your configuration as a workaround?

Just list all the plugins to be loaded. For example:

{
  "plugins": ["@stryker-mutator/typescript-checker", "@stryker-mutator/jest-runner"]
}

If that doesn't work, please report the error message you're receiving here.

@nicojs
Copy link
Member

nicojs commented Oct 25, 2021

I had a couple of minutes to spare and tested it out. It seems to work fine when specifying plugins. See this example project with jasmine:

pnpm-example.zip

I don't see an easy way to make StrykerJS automatically resolve the plugins, seeing as the pnpm file structure makes it harder to resolve them. Maybe documenting this solution would already be enough.

Do you agree @VVKot ?

@VVKot
Copy link
Author

VVKot commented Oct 25, 2021

Thanks for a quick response and for provided workaround @nicojs ! Yes, that indeed works for me - time to run tests is now down to 15 minutes. 🎉 I think that's a perfectly fine solution for now.

@nicojs nicojs added the hacktoberfest https://hacktoberfest.digitalocean.com/ label Oct 26, 2021
@nicojs
Copy link
Member

nicojs commented Oct 26, 2021

We're happy to accept PR's to improve the docs, maybe add a mention in our troubleshooting guide as well.

Furthermore, we could add pnpm to the list of package managers on stryker init and list the specific plugins installed using the init command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature request New feature request hacktoberfest https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants