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

Global configs in presets silently fail when set on a project. #6292

Closed
captbaritone opened this issue May 26, 2018 · 3 comments
Closed

Global configs in presets silently fail when set on a project. #6292

captbaritone opened this issue May 26, 2018 · 3 comments

Comments

@captbaritone
Copy link
Contributor

captbaritone commented May 26, 2018

🐛 Bug Report

I tried to install jest-puppeteer on Webamp and their docs advised me to add

{
  "preset": "jest-puppeteer"
}

to my "Jest Config".

Since I wanted these slow integration tests to be run separately from my normal tests, I created a new project for my integration tests. Unfortunately this did now work, since this preset contains some global configs:

{
  "globalSetup": "jest-environment-puppeteer/setup",
  "globalTeardown": "jest-environment-puppeteer/teardown",
  "testEnvironment": "jest-environment-puppeteer",
  "setupTestFrameworkScriptFile": "expect-puppeteer"
}

After adding the two global values to my root config, things seemed to work fine.

I'm not sure what the right solution is here:

  1. Hoist global config? This is bad because it defies the user's expectation that projects are independent.
  2. Error when you try to add a preset with a global value to a project?
  3. Disallow presets on projects all together?

@SimenB

@SimenB
Copy link
Member

SimenB commented May 26, 2018

The main issue I think is that it silently did not work - we're missing some validation of the shape of the configs after separating them.

As for correct behavior I think we'd have to either hoist magically global ones out of projects, or throw an explicit error saying it's not possible.

@cpojer?

@cpojer
Copy link
Member

cpojer commented May 26, 2018

Oh.. preset was designed before the config split happened. I'm not sure right now what the right solution is, though.

@SimenB
Copy link
Member

SimenB commented Jul 6, 2018

Duplicate of #5441

@SimenB SimenB marked this as a duplicate of #5441 Jul 6, 2018
@SimenB SimenB closed this as completed Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants