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

setupFilesAfterEnv is ignored then defined in a preset #7719

Closed
sbekrin opened this issue Jan 26, 2019 · 3 comments
Closed

setupFilesAfterEnv is ignored then defined in a preset #7719

sbekrin opened this issue Jan 26, 2019 · 3 comments

Comments

@sbekrin
Copy link

sbekrin commented Jan 26, 2019

🐛 Bug Report

Hey there 👋After upgrading to Jest 24, I've explored that both setupFilesAfterEnv and setupTestFrameworkScriptFile are ignored then defined in a preset. jest --showConfig is not showing them either. Other properties like setupFiles works as expected.

To Reproduce

Using a preset, add setupFilesAfterEnv property to it.

Expected behavior

Jest reads both setupFilesAfterEnv and setupTestFrameworkScriptFile from a preset.

Link to repl or repo (highly encouraged)

https://github.com/sbekrin/jest-24-setup-files-after-env-bug

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS 10.14.2
    CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
  Binaries:
    Node: 8.15.0 - ~/.nvm/versions/node/v8.15.0/bin/node
    Yarn: 1.12.3 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v8.15.0/bin/npm
  npmPackages:
    jest: ^24.0.0 => 24.0.0
@doniyor2109
Copy link
Contributor

It turns out setupTestFrameworkScriptFile validation is overwriting setupFilesAfterEnv preset options with empty value.

https://github.com/facebook/jest/blob/32bb032b856b6c351b47a61afea7c4052045640d/packages/jest-config/src/normalize.js#L400-L403

@thymikee
Copy link
Collaborator

Closed via #7724

@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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants