majestic

Zero config UI for Jest

Github星跟蹤圖

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):

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

概覽

名稱與所有者Raathigesh/majestic
主編程語言TypeScript
編程語言TypeScript (語言數: 2)
平台
許可證MIT License
發布數31
最新版本名稱v1.8.1 (發布於 2021-07-06 18:37:46)
第一版名稱v0.1.0 (發布於 )
創建於2017-11-28 10:28:30
推送於2022-05-03 14:54:05
最后一次提交2021-07-23 20:47:22
星數7.5k
關注者數54
派生數174
提交數556
已啟用問題?
問題數136
打開的問題數47
拉請求數85
打開的拉請求數4
關閉的拉請求數6
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?
去到頂部