MCPcopy
hub / github.com/vitest-dev/vitest / setupCommonEnv

Function setupCommonEnv

packages/vitest/src/runtime/setup-common.ts:11–25  ·  view source on GitHub ↗
(config: SerializedConfig)

Source from the content-addressed store, hash-verified

9
10let globalSetup = false
11export async function setupCommonEnv(config: SerializedConfig): Promise<void> {
12 setupDefines(config)
13 setupEnv(config.env)
14
15 if (globalSetup) {
16 return
17 }
18
19 globalSetup = true
20 setSafeTimers()
21
22 if (config.globals) {
23 (await import('../integrations/globals')).registerApiGlobally()
24 }
25}
26
27function setupDefines(config: SerializedConfig) {
28 for (const key in config.defines) {

Callers 3

setupGlobalEnvFunction · 0.90
runFunction · 0.90
prepareFunction · 0.85

Calls 3

setSafeTimersFunction · 0.90
setupDefinesFunction · 0.85
setupEnvFunction · 0.85

Tested by

no test coverage detected