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

Function assertMatchResult

packages/vitest/src/integrations/snapshot/chai.ts:307–318  ·  view source on GitHub ↗
(result: SyncExpectationResult, customMessage?: string)

Source from the content-addressed store, hash-verified

305}
306
307function assertMatchResult(result: SyncExpectationResult, customMessage?: string): void {
308 if (!result.pass) {
309 const errorMessage = (customMessage ? `${customMessage}: ` : '') + result.message()
310 throw Object.assign(new Error(errorMessage), {
311 actual: result.actual,
312 expected: result.expected,
313 diffOptions: {
314 expand: getWorkerState().config.snapshotOptions.expand,
315 },
316 })
317 }
318}
319
320/**
321 * Composable snapshot matcher helpers for building custom snapshot matchers

Callers 1

SnapshotPluginFunction · 0.85

Calls 1

getWorkerStateFunction · 0.90

Tested by

no test coverage detected