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

Function inject

packages/vitest/src/integrations/inject.ts:8–13  ·  view source on GitHub ↗
(
  key: T,
)

Source from the content-addressed store, hash-verified

6 * This usually returns a value provided by `globalSetup` or an external library.
7 */
8export function inject<T extends keyof ProvidedContext & string>(
9 key: T,
10): ProvidedContext[T] {
11 const workerState = getWorkerState()
12 return workerState.providedContext[key] as ProvidedContext[T]
13}

Callers 4

basic.test.jsFile · 0.90
glob.test.jsFile · 0.90

Calls 1

getWorkerStateFunction · 0.90

Tested by

no test coverage detected