-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocha-test-runner executes tests that should not be executed #4766
Comments
Great find 👏 How about the start of the regex? I would expect a |
Yes you are right, both caret and dollar sign are necessary. The possible fix for mocha-test-runner would then be: |
Did you want to fix this one @mcdr2k ? |
Yes, I would like to fix this one. However, at the moment I am investigating an issue that could be related to this. |
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: