1. jest-watch-select-projects
An experimental ESLint runner for Jest
jest-watch-select-projects
Package: jest-watch-select-projects
Created by: rogeliog
Last modified: Fri, 06 May 2022 12:50:27 GMT
Version: 2.0.0
License: MIT
Downloads: 959,115
Repository: https://github.com/rogeliog/jest-watch-select-projects

Install

npm install jest-watch-select-projects
yarn add jest-watch-select-projects

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.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code