Majestic is an electron app that provides a UI for running tests with Jest. Jest CLI itself provides one of the best testing experiences available today. But Majestic humbly tries to expand upon it by providing a rich UI to be used during the dev/test loop.
- Run the whole project, a file or a particular test with a click
- Watch the whole project, a file or a test
- Update specific snapshots with a click
- Inline coverage reports
- Zero configuration (Sorry, I had to)
- Support for typescript projects
- Support for Create-React-App out of the box
- Quick search to search across all your test (It) statements
- Failure summary shows all test failtures in a single screen. Useful when you have failures across multiple files.
- Locate a specific test in your editor with the click of a button
Ok, I lied partially about the zero config part.
Majestic is a zero config tool if you keep all your jest configuration in the package.json
file.
If you have an external jest
config file, you should have a jestConfig
key in the package.json
pointing to the file as shown below.
{
"name": "my-awesome-proj",
"version": "0.1.0",
"description": "..",
"jestConfig": "./jest-custom.config.js"
}
Majestic displays coverage reports generated by Jest. So make sure to have HTML coverage report configured so Majestic can display them.
It's really simple.
{
"collectCoverage": true,
"coverageReporters": ["html"]
}
- "test": "react-scripts test --env=jsdom",
+ "test": "react-scripts test --env=jsdom --coverage",
Majestic relies on jest-editor-support
, a module from jest, which allows the app to execute jest programmatically.
git clone https://github.com/facebook/jest.git
cd jest
yarn install
# link jest-editor-support
cd packages/jest-editor-support
yarn link
Now let's setup majestic.
git clone https://github.com/Raathigesh/majestic.git
cd majestic
# this would install and would do a yarn link for jest-editor-support
yarn install
# start the app
yarn dev
This tool is inspired by https://wallabyjs.com/. Check it out.
Thank you @orta for building VSCode Jest and doing the heavy lifting.
Raathigeshan 💻 📖 💬 👀 🤔 🎨 |
---|
This project follows the all-contributors specification. Contributions of any kind are welcome!
MIT © Raathigeshan