Skip to content
Zero config GUI for Jest
TypeScript JavaScript
Branch: master
Clone or download

Latest commit

gregveres and Greg Veres implement view snapshot button (#197)
This commit implements issue #186. I can't know if there is a snapshot
for each but I can add a button to the summary that opens the snapshot
for the file in the code editor. That's what this commit does. It adds
the button to the UI and a mutation to send to the server to open the
snapshot in the editor.
And it implements issue #191. There was already a button for generating
a snapshot, but it was only visible when there was a detected snapshot
error. This caused us to have to run known failing tests before we could
get the button to generate the snapshots. Now the button is there all
the time, so if you know your snapshots are out of date, then you can
generate them immediately and save time.

Co-authored-by: Greg Veres <greg.veres@rogers.com>
Latest commit f31897c May 21, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update nodejs.yml Oct 4, 2019
.vscode fixing some ide shit Apr 3, 2019
branding Update banner image Mar 25, 2019
integration Fix hidden update snapshots button (#187) May 4, 2020
scripts Added 'open' to externals so it works on Ubuntu Mar 28, 2019
server implement view snapshot button (#197) May 21, 2020
ui implement view snapshot button (#197) May 21, 2020
.all-contributorsrc docs: add adamkleingit as a contributor (#189) May 4, 2020
.babelrc 🚛 Upgrade babel-plugin-styled-components to 1.10.6 from 1.8.0 (#170) Nov 12, 2019
.gitignore Cleanup starter kit Dec 29, 2018
CONTRIBUTING.MD Fix Typos Apr 17, 2019
LICENSE Cleanup starter kit Dec 29, 2018
README.md docs: add adamkleingit as a contributor (#189) May 4, 2020
Troubleshooting.md Move troubleshooting to own file Apr 4, 2019
image.png Update banner image Mar 25, 2019
nodemon.json Cleanup starter kit Dec 29, 2018
package.json v1.7.0 May 6, 2020
tsconfig.json stuff Mar 6, 2019
tsconfig.server.json Bunch of stuff Mar 22, 2019
yarn.lock Fix hidden update snapshots button (#187) May 4, 2020

README.md


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

cd ./my-jest-project # go into a project with Jest
npx majestic # execute majestic

or install Majestic globally via Yarn and run majestic

yarn global add majestic # install majestic globally
cd ./my-jest-project # go into a project with Jest
majestic # execute majestic

or install Majestic globally via Npm and run majestic

npm install majestic -g # install majestic globally
cd ./my-jest-project # go into a project with Jest
majestic # execute majestic

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.

// package.json
{
    "majestic": {
        // if majestic fails to find the Jest package, you can provide it here. Should be relative to the package.json
        "jestScriptPath": "../node_modules/jest/bin/jest.js",
        // if you want to pass additional arguments to Jest, do it here
        "args": ['--config=./path/to/config/file/jest.config.js'],
        // environment variables to pass to the process
        "env": {
          "CI": "true"
        }
    }
}

Optional configuration in project with multiple Jest configuration files

{
    "majestic": {
        "jestScriptPath": "../node_modules/jest/bin/jest.js",
        "configs": {
          "config1": {
            "args": [],
            "env": {}
          },
          "config2": {
            "args": [],
            "env": {}
          }
        }
    }
}

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

⚠️ 💻

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

You can’t perform that action at this time.