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

Function assert

packages/vitest/src/node/core.ts:1670–1674  ·  view source on GitHub ↗
(condition: unknown, property: string, name: string = property)

Source from the content-addressed store, hash-verified

1668}
1669
1670function assert(condition: unknown, property: string, name: string = property): asserts condition {
1671 if (!condition) {
1672 throw new Error(`The ${name} was not set. It means that \`vitest.${property}\` was called before the Vite server was established. Await the Vitest promise before accessing \`vitest.${property}\`.`)
1673 }
1674}
1675
1676export type OnServerRestartHandler = (reason?: string) => Promise<void> | void
1677export type OnTestsRerunHandler = (testFiles: TestSpecification[]) => Promise<void> | void

Callers 13

summary.test.tsFile · 0.90
handlerFunction · 0.90
getConfigFunction · 0.90
recordArtifactMethod · 0.70
reportEventMethod · 0.70
configMethod · 0.70
viteMethod · 0.70
stateMethod · 0.70
snapshotMethod · 0.70

Calls

no outgoing calls

Tested by 2

handlerFunction · 0.72
getConfigFunction · 0.72