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.

Feature Request: Support having multiple test configs

See original GitHub issue

Expected Behavior

I have a project that in test folder I have unit, integration and functional tests. Each test folder has its own configuration and setup files.

It would be great to have possibility to map different configuration for different test folders.

Example:

{
  jest.instances: {
    "test/unit/*": "jest --config=./test/unit/config.js",
    "test/integration/*": "jest --config=./test/integration/config.js",
    "test/functional/*": "jest --config=./test/functional/config.js",
  }
}

So this way, for the test files under test/unit folder, extension will execute the corresponding command.

Actual Behavior

It doesn’t support this at the moment.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:19
  • Comments:11

github_iconTop GitHub Comments

4reactions
JPeer264commented, Oct 1, 2021

Following (as @askirmas suggested) works out of the box with jest. I adapted everything according to @yatki’s needs:

const createProject = (type) => ({
  transform: {
    '^.+\\.(t|j)sx?$': 'ts-jest',
  },
  globals: {
    'ts-jest': {
      isolatedModules: true,
    },
  },
  displayName: type,
  preset: 'ts-jest',
  globalSetup: `./__setup__/${type}/jest.global-setup.ts`,
  setupFilesAfterEnv: [`./__setup__/${type}/jest.setup-after-env.ts`],
  testRegex: `(/test/${type}/.*| (\\.| /)(test|spec))\\.[jt]sx?$`,
});

module.exports = {
  projects: [
    createProject('unit'),
    createProject('integration'),
    createProject('functional'),
  ],
};

With that config debug works just as expected on each folder.

2reactions
askirmascommented, Sep 6, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloud Feature Requests | CircleCI Ideas
Circle CI should generate a new build when a pull request is opened on github. ... I have found 2 additional configurations under...
Read more >
Better organize tests and run them against multiple ...
Test plans are a new feature of Xcode that let you run a subset of you tests (Unit or UI tests) against multiple...
Read more >
TestComplete Feature Requests - SmartBear Community
Hello we have upgraded to Chrome V107 and find that the latest TestComplete no longer "recognizes" various pop ups and the such when...
Read more >
Creating a Multi-Test - BlazeMeter Docs
You cannot add a specific test multiple times to the same multi-test with the same name. Instead, make one or more copies of...
Read more >
Testing with feature flags - GitLab Docs
When scope is set to :global , the test will be skipped on all live .com environments. This is to avoid issues with...
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