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

Proposal: pass config to globalSetup and globalTeardown #5957

Closed
gregberge opened this issue Apr 10, 2018 · 5 comments · Fixed by #6486
Closed

Proposal: pass config to globalSetup and globalTeardown #5957

gregberge opened this issue Apr 10, 2018 · 5 comments · Fixed by #6486

Comments

@gregberge
Copy link
Contributor

I am the maintainer of Jest Puppeteer project and I would like to suggest a new feature.

When I started Jest Puppeteer I wanted to make it as simple as possible. For this purpose, I wanted to be able to configure it only using Jest config. I found testEnvironmentOptions, it looked like the exact use case for me.

Jest Puppeteer needs globalSetup and globalTeardown, but these two methods do not have access to Jest config and by the way to testEnvironmentOptions. This is the reason why I introduced jest-puppeteer.config.js.

Today people are complaining about that additional config.

This was the context, now the request:

Could you pass config to globalSetup and globalTeardown? I think it is as simple as modifying this line.

Thanks for this amazing library!

@SimenB
Copy link
Member

SimenB commented Apr 10, 2018

Works for me, PR welcome :)

@gregberge
Copy link
Contributor Author

🎉

@backflip
Copy link
Contributor

backflip commented Sep 17, 2018

@neoziro, it looks like globalConfig does not include testEnvironmentOptions: https://github.com/facebook/jest/blob/master/packages/jest-config/src/index.js#L100-L152

Have you found a workaround for this?

I'm currently (mis)using projects: [{ myCustomConfig }].

@gregberge
Copy link
Contributor Author

@backflip I didn't work on it for now. But yes it will be a problem for Jest Puppeteer.

@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

Successfully merging a pull request may close this issue.

3 participants