jest-watch-select-projects

2.0.0 • Public • Published

Build Status npm version

jest-watch-select-projects

Select which Jest project to run

select-project

Usage

Install

Install jest(it needs Jest 23+) and jest-watch-select-projects

yarn add --dev jest jest-watch-select-projects
 
# or with NPM 
 
npm install --save-dev jest jest-watch-select-projects

Add it to your Jest config

In your package.json

{
  "jest": {
    "watchPlugins": ["jest-watch-select-projects"]
  }
}

Or in jest.config.js

module.exports = {
  watchPlugins: ['jest-watch-select-projects'],
};

Configuring your key and prompt name

module.exports = {
  watchPlugins: [
    [
      'jest-watch-select-projects',
      {
        key: 'X',
        // function or string
        prompt() {
          const activeProjectsText = this._getActiveProjectsText();
          return 'do something with my custom prompt';
        },
      },
    ],
  ],
};

Run Jest in watch mode

yarn jest --watch

FAQ

Why is this running all of my projects?

Make certain that you're using the SPACE key to toggle the selected state of projects and the ENTER key to confirm your settings.

Readme

Keywords

none

Package Sidebar

Install

npm i jest-watch-select-projects

Weekly Downloads

223,714

Version

2.0.0

License

MIT

Unpacked Size

8.5 kB

Total Files

5

Last publish

Collaborators

  • jeysal
  • mattphillips
  • simenb
  • rickhanlonii
  • thymikee
  • jsonp
  • orta
  • rogeliog