-
Notifications
You must be signed in to change notification settings - Fork 252
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
React propTypes
mutation.
#1653
Comments
For now i guess this is a bug. I don't see workaround. We might need to add some option to exclude given line or sth like this, the way it is done ex. in tslint or eslint |
Hi! Right now this is not possible to exclude. We have a general feature request for this: #1472 |
Hi, our team is interested in using Stryker to get the mutation test results, but almost all the files get this propTypes mutated and it brings the mutation test score down. We would like to know is there a possibility to exclude propTypes from getting mutated in Stryker. Is there any progress made on this? |
@itsmeraji I'll start working on #1472 very soon. It should be done until the end of this month I hope |
@kmdrGroch, Thank you for the reply. But will it be possible to add some configuration in Stryker.conf and disable proptypes mutation in all files automatically, based on the configuration ? If we have to add ignore comments, we ve to add ignore comment for proptypes in all the files.. |
@itsmeraji, for now, we are only planning to add the comments-based exclusion. In the future, we could write some plugin for it, but no hopes right now. |
@kmdrGroch, is there any update on this feature? I see PR #1810 created for this. |
It is still being worked on. Unfortunately this issue is quite complex so it takes time :< |
@kmdrGroch , I understand. I have been trying other options to ignore prototypes from mutation. I wrote a custom transpiler to remove a node if it has propTypes in assignment expression. When applying this as plugin in Babel and Jest transform, propTypes gets removed when I run a test. But the plugins / transpilers options in Stryker configuration doesn't allow a custom transpiler plugin like this. Even the plugins option within the mutator object allows only the plugins provided within babel-parser. Do you have any suggestions for me here ? To make the custom transpiler get applied before Stryker generates mutants ? We are blocked due to this. |
Question
When we're writing React component, we typically write
propTypes
validations so we know that the props we're passing to a component is of the correct type.Stryker is mutating these though even though they are for development purposes.

For those who have actually prevented Stryker from mutating these, what did you do?
The text was updated successfully, but these errors were encountered: