Closed
Description
🐛 Bug Report
Passing --onlyFailures
doesn't run failed tests only.
To Reproduce
// __tests__/a.test.js
it('fails', () => {
expect(true).toBeFalsy();
});
// __tests__/b.test.js
it('passes', () => {
expect(true).toBeTruthy();
});
// package.json
{
"dependencies": {
"jest": "23.1.0"
}
}
- Run "npm install"
- Run all tests initially with
./node_modules/jest/bin/jest.js
=> 1 passed, 1 failed as expected. - Rerun failed tests only with
./node_modules/jest/bin/jest.js --onlyFailures
. Unexpectedly, all tests are run again.
Expected behavior
A single failed test is rerun.
Link to repl or repo (highly encouraged)
https://repl.it/@sergey_simonchik/rerun-failed-tests
Run npx envinfo --preset jest
System:
OS: Linux 4.8 Linux Mint 18.1 (Sonya)
CPU: x64 Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz
Binaries:
Node: 10.4.0 - ~/.nvm/versions/node/v10.4.0/bin/node
npm: 6.1.0 - ~/.nvm/versions/node/v10.4.0/bin/npm
npmPackages:
jest: 23.1.0 => 23.1.0