Skip to content

unional/jest-watch-suspend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 14, 2024
7511d1d · Jan 14, 2024

History

37 Commits
Nov 19, 2019
Jan 14, 2024
Nov 19, 2019
Dec 31, 2018
Dec 31, 2018
Sep 24, 2018
Dec 31, 2018
Nov 19, 2019
Dec 31, 2018
Nov 19, 2019
Dec 31, 2018
Jul 23, 2019
Nov 19, 2019
May 13, 2019
Nov 19, 2019
Dec 31, 2018
Dec 31, 2018
Dec 31, 2018
Oct 24, 2021

Repository files navigation

jest-watch-suspend

NPM version NPM downloads Mentioned in Awesome Jest

Circle CI Travis CI Codecov Coveralls Status

Greenkeeper Semantic Release

Visual Studio Code Wallaby.js

Pausing/resuming jest watch mode.

Requires jest@23+.

Usage

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

{
  "jest": {
    "watchPlugins": [
      // default
      "jest-watch-suspend",
      // configure
      [
        "jest-watch-suspend", {
          // override key press
          "key": "s",
          // override prompt
          "prompt": "suspend watch mode",
          // starts in suspend mode
          "suspend-on-start": true
        }
      ]
    ]
  }
}

Use Cases

Suspend on start:

  • (suspended) ➣ [p] + <filter> | [t] + <filter>[s] (resume)

Setup both path and name filter before running tests:

  • [s] (suspend) ➣ [p] + <filter> & [t] + <filter>[s] (resume)

Change multiple files before running tests:

  • [s] (suspend) ➣ multiple changes and file saves ➣ [s] (resume)

Run code coverage after running some test.only() tests:

  • [s] (suspend) ➣ change test.only() back to test() & [e] (with jest-watch-toggle-config) ➣ [s] (resume)