question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for multiple jest runners in one project

See original GitHub issue

Suppose having different jest configs for unit and e2e tests. Whenever running tests in majestic GUI majestic config in package.json has to be changed. How about switching from:

"majestic": {
    "jestScriptPath": "./node_modules/jest/bin/jest.js",
    "args": ["--config=./config/jest/e2e.json"]
}

to something like this:

"majestic": {
    "jestScriptPath": "./node_modules/jest/bin/jest.js",
    "runners": {
        "unit": ["--config=./config/jest/unit.json"],
        "e2e": ["--config=./config/jest/e2e.json"]
    }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MacZelcommented, Apr 7, 2019

That’s exactly what I meant

1reaction
Raathigeshcommented, Apr 7, 2019

How about having named configs like below

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

and then when starting Majestic you could pass a flag like --config=unit?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest 20: Delightful Testing & Multi-Project-Runner
We made a number of additions and improvements to the testing APIs which will help write more effective tests. We'd like to point...
Read more >
Support maxWorkers or runInBand when using 'projects' #10936
Setup a mono-repo with two jest config files; Set one to maxWorkers: 1; Add both config paths to base projects property; Run jest...
Read more >
How do you setup multiple jest configs within a single project?
The solution I found was to pass a flag into the config. module. exports = () => { // only collect cover if...
Read more >
2 Methods for Running Multiple Jest Suites in the Same Project
Why Run Multiple Test Suites Separately · The Scenario · Method #1: CLI Arguments · Method #2: Dynamic Configuration with Environment Variables ·...
Read more >
vscode-jest-runner - Visual Studio Marketplace
Extension for Visual Studio Code - Simple way to run or debug a single (or multiple) tests from context-menu.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found