Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuration objects in "projects" #5174

Closed
azz opened this issue Dec 25, 2017 · 2 comments · Fixed by #5176
Closed

Allow configuration objects in "projects" #5174

azz opened this issue Dec 25, 2017 · 2 comments · Fixed by #5176

Comments

@azz
Copy link
Contributor

azz commented Dec 25, 2017

Do you want to request a feature or report a bug?

Feature.


A pattern I have been repeating recently is using the "projects" feature to run many runners in the same build. To do this I do:

package.json:

{
  "jest": {
    "projects": ["jest.*.config.js"]
  }
}

jest.eslint.config.js:

module.exports = {
  runner: "jest-runner-eslint",
  displayName: "lint",
  // ...
};

jest.test.config.js:

module.exports = {
  displayName: "test",
  // ...
};

This all works fine but it is a bit annoying having three config sources. What I propose is the ability to pass configuration objects instead of paths in the "projects" array.

For example, we could express all three of the above configuration components with one file:

jest.config.js:

const lint = {
  runner: "jest-runner-eslint",
  displayName: "lint",
  // ...
};

const test =  {
  displayName: "test",
  // ...
};

module.exports = {
  projects: [lint, test]
}
@SimenB
Copy link
Member

SimenB commented Dec 25, 2017

I like it 🙂 Would make custom runners even easier to use, and your example of an easy way of doing lint and test together seems really compelling for Jest as more than a test runner (combined with presets and we're really getting places).

Would you be able to create a PR for it?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants