Stryker: SwitchCase mutation mishandles empty fallthrough cases

Created on 22 Sep 2018  路  4Comments  路  Source: stryker-mutator/stryker

Summary

When handling an empty fallthrough case, e.g.:

switch (value) {
  case 'A':
  case 'B':
    ...
}

SwitchCase will raise an unchanged (thus unkillable) mutant which simply removes + readds the case 'A' (maybe changing the formatting slightly, but not the semantics).

Stryker config

module.exports = function(config) {
  config.set({
    mutator: "javascript",
    packageManager: "npm",
    reporters: ["clear-text", "progress"],
    testRunner: "jest",
    transpilers: [],
    coverageAnalysis: "off",
    mutate: ["src/**/*.js"]
  });
};

Stryker environment

[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

Your Environment

| software | version(s)
| ---------------- | -------
| node | multiple
| npm | multiple
| Operating System | multiple

Add stryker.log


stryker.log

Executable repro repo here.

馃悰 Bug

Most helpful comment

No problem, will put in a fix this evening. Thanks for letting me know

All 4 comments

Thanks for reporting. This is most definitely a bug. It is recently introduced as this is a new mutator. @tommilligan would you mind taking a look? Maybe if you have some time, fixing this issue? Thanks for any feedback you might have.

No problem, will put in a fix this evening. Thanks for letting me know

@nicojs I think it is ready to close

Closing this issue, when you encounter further problems feel free to reopen.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

simondel picture simondel  路  25Comments

anthony-telljohann picture anthony-telljohann  路  19Comments

j-truax picture j-truax  路  20Comments

kmdrGroch picture kmdrGroch  路  19Comments

jeznag picture jeznag  路  17Comments