Stryker: ArrowFunction mutation question

Created on 9 Jul 2020  路  5Comments  路  Source: stryker-mutator/stryker

Question

I don't get this mutation. Why did this fail?


[2020-07-09T21:03:12.538Z] 3. [Survived] ArrowFunction

[2020-07-09T21:03:12.538Z] /src/accordion/accordion-base.tsx:77:13

[2020-07-09T21:03:12.538Z] -       onClick: () => undefined,

[2020-07-09T21:03:12.538Z] +       onClick: () => undefined,
馃悰 Bug

Most helpful comment

@simondel btw, should check if

function () {   }

is mutated properly, coz it will probably be mutated to the same one

All 5 comments

Thanks for opening this issue! It turns out this is a bug unfortunately. We don't check if the content of your function is undefined, we simply replace it with undefined. In your specific scenario this causes the mutated code to be the same as your original code.

@nicojs Shall we fix this with v4?

@simondel btw, should check if

function () {   }

is mutated properly, coz it will probably be mutated to the same one

Cool beans! Thanks, @simondel and @kmdrGroch

BTW, for now I changed our default to () => { }.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

simondel picture simondel  路  17Comments

jeznag picture jeznag  路  17Comments

nosideeffects picture nosideeffects  路  32Comments

davesag picture davesag  路  17Comments

anthony-telljohann picture anthony-telljohann  路  19Comments