stryker-mutator / stryker-js

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

fix(instrumenter): don't place mutants inside delete expressions #4742

Closed nicojs closed 4 months ago

nicojs commented 4 months ago

Don't place mutants inside a delete expression.

Before:

delete stryMutAct_9fa48(\\"11\\") ? myVariable[indexer] : (stryCov_9fa48(\\"11\\"), myVariable?.[indexer]);

After:

stryMutAct_9fa48(\\"11\\") ? delete myVariable[indexer] : (stryCov_9fa48(\\"11\\"), delete myVariable?.[indexer]);

Fixes #4741