Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rogeliog/jest-watch-select-projects
Select which Jest projects to run
https://github.com/rogeliog/jest-watch-select-projects
Last synced: 27 days ago
JSON representation
Select which Jest projects to run
- Host: GitHub
- URL: https://github.com/rogeliog/jest-watch-select-projects
- Owner: jest-community
- License: mit
- Created: 2018-05-30T04:39:50.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-10-26T09:41:04.000Z (about 1 year ago)
- Last Synced: 2024-04-14T08:42:54.381Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 176 KB
- Stars: 65
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-jest - jest-watch-select-projects
README
[![Build Status](https://travis-ci.org/jest-community/jest-watch-select-projects.svg?branch=master)](https://travis-ci.org/jest-community/jest-watch-select-projects) [![npm version](https://badge.fury.io/js/jest-watch-select-projects.svg)](https://badge.fury.io/js/jest-watch-select-projects)
![select-project](https://user-images.githubusercontent.com/574806/40741798-3ca7c250-6401-11e8-8398-d39ab4eea011.gif)
## Usage
### Install
Install `jest`_(it needs Jest 23+)_ and `jest-watch-select-projects`
```bash
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`
```json
{
"jest": {
"watchPlugins": ["jest-watch-select-projects"]
}
}
```Or in `jest.config.js`
```js
module.exports = {
watchPlugins: ['jest-watch-select-projects'],
};
```### Configuring your key and prompt name
```js
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
```bash
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.