-
Notifications
You must be signed in to change notification settings - Fork 252
Allow mutating of es decorators with mutation switching #2415
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
Comments
Maybe it's better to allow for a custom ignore plugin syntax. This way we can support other use cases as well, instead of making an exception for checking on node type. Related use cases are specified in these issues: #2400 , #2257 It might look like this: {
"mutator": {
"ignorePlugins": [
"angularDecorators" // ignore plugin name here
]
}
} We can start with a private mutant ignore plugin api and make it public if it turns out this is a much requested feature. The We should add the We could choose to fix this after the 4.0 milestone if we really wanted to and later have a small (breaking for angular users) change to fix this. @simondel @hugo-vrijswijk and others. what do you think of this approach? |
Discussed with @simondel and we feel like moving this outside of the 4.0 milestone. If someone disagrees let me know. |
Duplicate of #1681 |
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. |
Hi @nicojs, we are using Stryker in a nestjs project and would like Stryker to also mutate our decorators. Is this something that is already possible now (can't find it in the documentation)? Is there still an issue for Angular (which could be solved with an ignore plugin) or could we enable mutations on decorators? |
Is your feature request related to a problem? Please describe.
Currently, in Stryker 4 beta (3), we're not mutating decorators.
https://github.com/stryker-mutator/stryker/blob/cd439522650fe59c1607d00d58d331b5dc45fe39/packages/instrumenter/src/transformers/babel-transformer.ts#L19
The reason for this, is that angular projects can't handle mutating in their decorators with mutation switches in them.
For example:
Running
ng test
results in failed tests:This happens (I think) because angular uses it's own (pre) compiler (Ivy). This compiler uses the decorators in a precompile step. They need to have constant values.
I don't like the fact that we're ignoring all decorators because of a problem in angular projects.
Describe the solution you'd like
I think we should make the skipping of decorators optional. For example:
I think the default for
ignoreNodes
should be[]
(no nodes should be ignored).When someone uses
stryker init
and chooses angular, we should make sure to adddecorator
to the ignore nodes.Describe alternatives you've considered
stryker ignore next
. That's a lot of work.The text was updated successfully, but these errors were encountered: