-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
passing variable from globalSetup to test suites #2238
Comments
I highly doubt we will do this, since each test file is isolated and you will need to run globalSetup again, which is just a setupFile, but it's still possible to have a single puppeteer instance and share some context. You can see how it's done in Vite tests: https://github.com/vitejs/vite/tree/main/playground |
mm ok, u wrote the wsEndpoint to a file and then connect to it each time... with jest, I created a test environment and then attach the instance to global. |
Jest has it's own system, we only provide similar API. The internals are very different. Environments are basically the same as using |
Just wanted to ask, is there a drawback in directly adding the ws endpoint to process.env.something (instead of writing it to a file and reading later)? |
If it works, it works 😄 We can't provide this API, so I am closing the issue. |
Clear and concise description of the problem
i would like to use a global puppeteer instance to run different test files on different puppeteer tabs.
so for that, I want to initialize a global puppeteer instance and pass It down to each test Suite
Unfortunately, the test files are different than the globalSetup file, so i can't attach it to the instance to the globalSetup file global.
Suggested solution
maybe have the ability to share the global variable between test files and globalsetup
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: