Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 10, 2022
1 parent ba35d24 commit 62d95d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/vitest/src/plugins/globalSetup.ts
Expand Up @@ -59,6 +59,9 @@ export const GlobalSetupPlugin = (): Plugin => {
},

async buildStart() {
if (!server.config.test?.globalSetup)
return

globalSetupFiles = await loadGlobalSetupFiles(server)
for (const globalSetupFile of globalSetupFiles) {
const teardown = await globalSetupFile.setup?.()
Expand Down
1 change: 1 addition & 0 deletions packages/vitest/src/types/config.ts
Expand Up @@ -168,6 +168,7 @@ export interface InlineConfig {
* Path to global setup files
*/
globalSetup?: string | string[]

/**
* Pattern of file paths to be ignore from triggering watch rerun
*
Expand Down
2 changes: 1 addition & 1 deletion test/global-setup/package.json
@@ -1,5 +1,5 @@
{
"name": "@vitest/test-globalSetup",
"name": "@vitest/test-global-setup",
"private": true,
"type": "module",
"scripts": {
Expand Down

0 comments on commit 62d95d5

Please sign in to comment.