You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mocha-test-runner may execute tests for a mutant that do not cover that mutant (even though coverageAnalaysis is enabled). Assume that the test titled 'some test' covers mutant x. Then, at the moment, a test titled 'some test that does not cover x' is also executed. In fact, every test that starts with the string 'some test' is executed.
It is unclear whether other test-runners have the same issue.
** Cause & possible Fix **
caused by mocha-test-runner: const metaRegExp = testFilter.map((testId) => `(${escapeRegExp(testId)})`).join('|');
This can be fixed by appending a dollar sign after the escaped regex: const metaRegExp = testFilter.map((testId) => `(${escapeRegExp(testId) + '$'})`).join('|');
Stryker config
This bug was found during development with stryker-js, meaning that all configurations are the same as the current master branch of stryker-js.
The text was updated successfully, but these errors were encountered:
Yes you are right, both caret and dollar sign are necessary. The possible fix for mocha-test-runner would then be: const metaRegExp = testFilter.map((testId) => `(^${escapeRegExp(testId)}$)`).join('|');
Summary
Mocha-test-runner may execute tests for a mutant that do not cover that mutant (even though coverageAnalaysis is enabled). Assume that the test titled 'some test' covers mutant x. Then, at the moment, a test titled 'some test that does not cover x' is also executed. In fact, every test that starts with the string 'some test' is executed.
It is unclear whether other test-runners have the same issue.
** Cause & possible Fix **
caused by mocha-test-runner:
const metaRegExp = testFilter.map((testId) => `(${escapeRegExp(testId)})`).join('|');
This can be fixed by appending a dollar sign after the escaped regex:
const metaRegExp = testFilter.map((testId) => `(${escapeRegExp(testId) + '$'})`).join('|');
Stryker config
This bug was found during development with stryker-js, meaning that all configurations are the same as the current master branch of stryker-js.
The text was updated successfully, but these errors were encountered: