Majestic

Zero config GUI for Jest

README


Join the community on Spectrum

Majestic is a GUI for Jest

- ✅ Run all the tests or a single file
- ⏱ Toggle watch mode
- 📸 Update snapshots
- ❌ Examine test failures as they happen
- ⏲ Console.log() to the UI for debugging
- 🚔 Built-in coverage report
- 🔍 Search tests
- 💎 Works with flow and typescript projects
- 📦 Works with Create react app

Majestic supports Jest 20 and above


Get started


Run majestic via npx in a project directory

  1. ``` sh
  2. cd ./my-jest-project # go into a project with Jest
  3. npx majestic # execute majestic
  4. ```

or install Majestic globally via Yarn and run majestic

  1. ``` sh
  2. yarn global add majestic # install majestic globally
  3. cd ./my-jest-project # go into a project with Jest
  4. majestic # execute majestic
  5. ```

or install Majestic globally via Npm and run majestic

  1. ``` sh
  2. npm install majestic -g # install majestic globally
  3. cd ./my-jest-project # go into a project with Jest
  4. majestic # execute majestic
  5. ```

Running as an app


Running with the --app flag will launch Majestic as a chrome app.

Optional configuration


You can configure Majestic by adding majestic key to package.json.

  1. ``` js
  2. // package.json
  3. {
  4.     "majestic": {
  5.         // if majestic fails to find the Jest package, you can provide it here. Should be relative to the package.json
  6.         "jestScriptPath": "../node_modules/jest/bin/jest.js",
  7.         // if you want to pass additional arguments to Jest, do it here
  8.         "args": ['--config=./path/to/config/file/jest.config.js'],
  9.         // environment variables to pass to the process
  10.         "env": {
  11.           "CI": "true"
  12.         }
  13.     }
  14. }
  15. ```

Optional configuration in project with multiple Jest configuration files


  1. ``` js
  2. {
  3.     "majestic": {
  4.         "jestScriptPath": "../node_modules/jest/bin/jest.js",
  5.         "configs": {
  6.           "config1": {
  7.             "args": [],
  8.             "env": {}
  9.           },
  10.           "config2": {
  11.             "args": [],
  12.             "env": {}
  13.           }
  14.         }
  15.     }
  16. }
  17. ```

Arguments


--config - Will use this config from the list supplied in optional configuration.

--debug - Will output extra debug info to console. Helps with debugging.

--noOpen - Will prevent from automatically opening the UI url in the browser.

--port - Will use this port if available, else Majestic will pick another free port.

--version - Will print the version of Majestic and will exit.

Shortcut keys


alt+t - run all tests

alt+enter - run selected file

alt+w - watch

alt+s - search

escape - close search

Troubleshooting


Have a look at some of the common workarounds.

Contribute


Have a look at the contribution guide.

Contributors


Thanks goes to these wonderful people (emoji key):


Duncan Beevers

💻

Max Bridgland

📖 🤔 🐛 💻

Yuraima Estevez

💻

Jake Crosby

💻

Gavin Henderson

💻

briwa

💻

Luan Ferreira

💻

Tushar Gupta

💻

Agusti Fernandez

💻 🤔

Moos

🐛 💻 📖

MacZel

💻 🤔

Vikram Dighe

💻

John Smey

💻 🤔 🐛

BuckAMayzing

💻 🐛

Rahul A. Krishna

💻 🤔 🔧

Amila Welihinda

🚇

gregveres

🐛 💻

adam klein

⚠️ 💻

Raphaël Barbazza

💻

Phil Alsford

📖

This project follows the all-contributors specification. Contributions of any kind welcome!