Skip to content

Commit

Permalink
Fix one-line environment options
Browse files Browse the repository at this point in the history
  • Loading branch information
hahanein committed Feb 2, 2024
1 parent ae73f27 commit 597d80c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vitest/src/utils/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function groupFilesByEnv(files: (readonly [WorkspaceProject, string

const transformMode = getTransformMode(project.config.testTransformMode, file)

const envOptions = JSON.parse(code.match(/@(?:vitest|jest)-environment-options\s+?(.+)/)?.[1] || 'null')
const envOptions = JSON.parse(code.match(/@(?:vitest|jest)-environment-options\s+?(.+)(?=\*\/$|$)/)?.[1] || 'null')
const envKey = env === 'happy-dom' ? 'happyDOM' : env
const environment: ContextTestEnvironment = {
name: env as VitestEnvironment,
Expand Down

0 comments on commit 597d80c

Please sign in to comment.