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

Function resolveTestFixtureValue

packages/runner/src/fixture.ts:439–454  ·  view source on GitHub ↗
(
  fixture: TestFixtureItem,
  context: TestContext & { [key: string]: any },
  cleanupFnArray: (() => void | Promise<void>)[],
)

Source from the content-addressed store, hash-verified

437}
438
439function resolveTestFixtureValue(
440 fixture: TestFixtureItem,
441 context: TestContext & { [key: string]: any },
442 cleanupFnArray: (() => void | Promise<void>)[],
443) {
444 if (!isFixtureFunction(fixture.value)) {
445 return fixture.value
446 }
447
448 return resolveFixtureFunction(
449 fixture.value,
450 fixture.name,
451 context,
452 cleanupFnArray,
453 )
454}
455
456const scopedFixturePromiseCache = new WeakMap<TestFixtureItem, Promise<unknown>>()
457

Callers 1

withFixturesFunction · 0.85

Calls 2

isFixtureFunctionFunction · 0.85
resolveFixtureFunctionFunction · 0.85

Tested by

no test coverage detected