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
feat: save vitest state in global variable #739
Conversation
✔️ Deploy Preview for vitest-dev ready! 🔨 Explore the source changes: d4fb702 🔍 Inspect the deploy log: https://app.netlify.com/sites/vitest-dev/deploys/6207ab6960ef2c0008b1de5a 😎 Browse the preview: https://deploy-preview-739--vitest-dev.netlify.app |
packages/vitest/globals.d.ts
Outdated
@@ -11,5 +11,6 @@ declare global { | |||
const afterAll: typeof import('vitest')['afterAll'] | |||
const beforeEach: typeof import('vitest')['beforeEach'] | |||
const afterEach: typeof import('vitest')['afterEach'] | |||
let __vitest_worker__: import('vitest').WorkerGlobalState |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't expose this to user type. Let's have it in the source code which will be removed in build
Would be nice to have a test for this. Check that re-assigning |
no, it will break, but with other error because use the process in any space? and we cache the process in the global variable and make the user mock? |
@Demivan |
I don't think 1538626 is needed. Users can still break it by re-assigning properties on |
ok! |
This reverts commit 1538626.
Co-authored-by: webfansplz <> Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
fix: #663
save vitest state in global variable for the nice error message.