-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
preset
config option not recognized when there are projects
#6026
Comments
I am facing the same problem. Using two projects, where one specified a jest-puppeteer preset, I can observe the following:
However, I only have one of the project configs making use of puppeteer and could work around the issue by listing it first. |
It looks like this is not an issue with the {
"devDependencies": {
"jest-environment-node": "^22.0.0",
"jest-puppeteer": "^2.3.0",
"puppeteer": "^1.3.0"
},
"jest": {
"projects": [
{
"displayName": "unit",
"testMatch": ["<rootDir>/tests/unit/*.test.js"]
},
{
"displayName": "e2e",
"globalSetup": "jest-environment-puppeteer/setup",
"globalTeardown": "jest-environment-puppeteer/teardown",
"testEnvironment": "jest-environment-puppeteer",
"setupTestFrameworkScriptFile": "expect-puppeteer",
"testMatch": ["<rootDir>/tests/e2e/*.js"]
}
]
}
} @melissachang for me
works. Your example code is invalid JSON. If I move the preset out of the projects it does work. Which is confusing, because the unit tests do not work with the pupeteer preset. It looks like jest needs to know about the preset so it can be used inside the project config. To be clear: with this JSON both tests run successfully. {
"devDependencies": {
"jest-environment-node": "^22.0.0",
"jest-puppeteer": "^2.3.0",
"puppeteer": "^1.3.0"
},
"jest": {
"preset": "jest-puppeteer",
"projects": [
{
"displayName": "unit",
"testMatch": [
"<rootDir>/tests/unit/*.test.js"
]
},
{
"displayName": "e2e",
"preset": "jest-puppeteer",
"testMatch": [
"<rootDir>/tests/e2e/*.js"
]
}
]
}
} |
Duplicate of #6292 |
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. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
preset
property in project config is ignored. Repro steps:Test fails because
preset
inpackage.json
is not recognized.package.json:
What is the expected behavior?
preset
should be recognized when runningtests/e2e/test.js
.preset
out of projects:jest
still fails.preset
is still not recognized when runningtests/e2e/test.js
.Finally,
jest
passes.preset
is recognized.There are several bugs, besides this one, with project configuration: #5938, #5597, #5441, #5260. I'm sure some subset are dupes.
Please provide your exact Jest configuration
jest: v22.4.3
Run
npx envinfo --preset jest
in your project directory and paste theresults here
The text was updated successfully, but these errors were encountered: