jest-watch-repeat

Repeat test suite multiple times

MIT 11 个版本
安装
npm install jest-watch-repeat
yarn add jest-watch-repeat
pnpm add jest-watch-repeat
bun add jest-watch-repeat
README

jest-watch-repeat

NPM version NPM downloads Mentioned in Awesome Jest

Loop tests n times.

Requires jest@23+.

Usage

To use jest-watch-repeat, add it to the watchPlugins section of the Jest configuration:

{
  "jest": {
    "watchPlugins": [
      "jest-watch-repeat", // or
      ["jest-watch-repeat", { "key": "r", "prompt": "repeat test runs." }],
      // options:
      ["jest-watch-repeat", {
        // always repeat, even if some tests failed.
        'always-repeat': true
      }]
    ]
  }
}

In watch mode, press r to invoke a prompt and enter number of times you want the tests to be repeated:

Watch Usage
 › Press a to run all tests.
 › Press f to run only failed tests.
 › Press p to filter by a filename regex pattern.
 › Press t to filter by a test name regex pattern.
 › Press q to quit watch mode.
 › Press r to repeat test runs.
 › Press Enter to trigger a test run.
Repeat Mode Usage
 › Press Esc to exit repeat mode.
 › Press Enter to repeat test run n times.
 repeat › 3
Run only failed tests?
 (Y/N) > N
版本列表
3.0.1 2023-06-11
3.0.0 2023-06-11
2.0.0 2019-11-27
1.1.4 2019-11-27
1.1.3 2019-07-20
1.0.5 2019-07-11
1.0.4 2019-05-13
1.0.3 2019-05-05
1.0.2 2019-03-19
1.0.1 2019-02-18
1.0.0 2018-10-23