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
Summary
Some tests run each time in incremental mode. I expect the tests to be skipped on the second run.
The tests like:
test.each` x | y | expected${1} | ${1} | ${2}${1} | ${2} | ${3}${2} | ${2} | ${4}`("add($x, $y) = $expected",({ x, y, expected })=>{expect(add(x,y)).toBe(expected);});
When such a test exists, stryker shows Tests: 1 files changed (+2 -0) even though I haven't changed any tests.
The cause seems to be that each test has the same start position. This code removes tests with the same start position.
Reproduction steps:
$ git clone https://github.com/mkizka/stryker-js-jest-each
$ cd stryker-js-jest-each
$ yarn
$ yarn stryker run --incremental
$ yarn stryker run --incremental
Expected behavior:
All tests are skipped the second time.
Actual behavior:
Some tests run the second time.
I'm using google translate, so I'm sorry if there are strange parts in the sentences.
Stryker config
{
"$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
"_comment": "This config was generated using 'stryker init'. Please take a look at: https://stryker-mutator.io/docs/stryker-js/configuration/ for more information.",
"packageManager": "yarn",
"reporters": ["html", "clear-text", "progress"],
"testRunner": "jest",
"testRunner_comment": "More information about the jest plugin can be found here: https://stryker-mutator.io/docs/stryker-js/jest-runner",
"coverageAnalysis": "perTest"
}
Hi @mkizka, thanks for opening this issue with detailed reproduction steps!
This is a bug, but not in the line of code you're referring to the problem is here. I forgot to account for more than 1 test starting on the same line when they are the last test in the file 🤦♀️.
A current workaround is to add a final test under the tests with the same start position:
Summary
Some tests run each time in incremental mode. I expect the tests to be skipped on the second run.
The tests like:
When such a test exists, stryker shows
Tests: 1 files changed (+2 -0)
even though I haven't changed any tests.The cause seems to be that each test has the same start position. This code removes tests with the same start position.
Reproduction steps:
Expected behavior:
All tests are skipped the second time.
Actual behavior:
Some tests run the second time.
I'm using google translate, so I'm sorry if there are strange parts in the sentences.
Stryker config
Stryker environment
Test runner environment
Your Environment
Add stryker.log
stryker.log (second run in reproduction steps)
The text was updated successfully, but these errors were encountered: