Skip to content

Docs - Global setup #1244

@howlettt

Description

@howlettt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions