-
Notifications
You must be signed in to change notification settings - Fork 289
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
Load jest-puppeteer.config.js from <rootDir> #160
Comments
Hello @donaldpipowitch, originally I would like to get rid of It is actually blocked because a part of config is not avalaible in global hooks. Maybe using If we can’t I don’t want to invest more effort on it, I prefer to submit some changes in Jest to be able to get rid of it. |
Do you have specific questions? :) I only know this from |
I just gave a look, We are stuck :( |
I see :( |
Any information of this proposal ? Or is there any way to include this config in jest config, or in package.json ? I face the same problem. |
Right now, you can make jest-puppeteer load jest-puppeteer.config.js from the same directory as jest.config.js by putting this in your jest.config.js: process.env.JEST_PUPPETEER_CONFIG = require.resolve('./jest-puppeteer.config.js'); (I'd love it if this wasn't necessary and was the default behavior.) |
Thanks @Macil , it's still a good workaround |
@gregberge https://github.com/smooth-code/jest-puppeteer#jest-puppeteerconfigjs specifically says:
Considering "root" is often used as "rootDir" in Jest config and also if you use the 'projects' property, it would be nice to at least use in the code where it is called. I understand you might want to get rid of jest-puppeteer.config.js but as the issue was submitted a year ago, maybe this could be considered anyway as it makes it more natural than using the env var? |
Stale, feel free to open a new issue if you have this problem. |
🚀 Feature Proposal
When I place my Jest config in a sub-directory my tests actually have a new
<rootDir>
, but thejest-puppeteer.config.js
is still loaded from the root of my project.It would be nice however, if I could do this by default.
Motivation
IMHO it is more natural to respect the
<rootDir>
of Jest and easier to learn/to "do right". Currently I can setJEST_PUPPETEER_CONFIG
, but this is something I need to look up and it is also less "shareable".An alternative to get rid of
JEST_PUPPETEER_CONFIG
in the case you don't wan't to respect<rootDir>
by default would be to make it configurable similar to howts-jest
handles thetsconfig.json
:That is still something I need to look up, but at least it is easier to share and I can use
<rootDir>
.Example
If you don't place your Jest configs in sub-directories everything still works like usual:
If you do place your Jest configs in sub-directories, you can place the corresponding
jest-puppeteer.config.js
in the same directory without the need to add custom environment variables.Pitch
What is the SVGR ecosystem?
The text was updated successfully, but these errors were encountered: