-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Is your feature request related to a problem? Please describe.
Specifically, I have lots of packages that do feature-detection - something that, eg, works in node 20 and not in node 18 - and so running the tests in node 20 won't "survive" mutation of that feature-detection precisely because it would require the older engine to test.
If I run the tests in node 18, then a different complementary set of code will "survive" mutation.
Describe the solution you'd like
This problem occurs in code coverage as well, and the industry-wide solution there is to generate coverage reports as files on disk, and then to merge those after CI is done, and then report on the final result - meaning, in order for a mutation to have "survived", it has to have done so in every input to the merged final report.
Describe alternatives you've considered
Asking for the ability to have "ignore mutation" comments or similar; manually ignoring results I know aren't a problem; or not using this mutation approach at all.
Additional context
[Survived] ConditionalExpression
index.js:1:14
- var hasMap = typeof Map === 'function' && Map.prototype;
+ var hasMap = true;
in an engine without native Map
, this mutation will fail a great many tests; but in an engine with it, it will survive. This should not be reported, as long as I'm able to run the mutation on a node version without Map
(or, as long as I'm able to run a "preamble" that deletes Map
before running the tests and mutations).