The global setup Vitest example seems to be messed up. The setup.js file contents seems to be for a globalSetup file but it's passed as setupFiles in vite.config.js.
Possible fixes:
- Pass
setup.js as globalSetup instead
- Problem:
globalThis then doesn't work in tests since they have different global scopes
- Change
setup.js to work as a setupFiles
- Problem:
setupFiles are run before each test file
- Pass data from
globalSetup using project.provide docs
- Problem: only serializable data can be passed
The global setup Vitest example seems to be messed up. The
setup.jsfile contents seems to be for a globalSetup file but it's passed as setupFiles invite.config.js.Possible fixes:
setup.jsasglobalSetupinsteadglobalThisthen doesn't work in tests since they have different global scopessetup.jsto work as asetupFilessetupFilesare run before each test fileglobalSetupusingproject.providedocs