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

Method assert

packages/snapshot/src/client.ts:201–212  ·  view source on GitHub ↗
(options: AssertOptions)

Source from the content-addressed store, hash-verified

199 }
200
201 assert(options: AssertOptions): void {
202 const result = this.match(options)
203 if (!result.pass) {
204 const snapshotState = this.getSnapshotState(options.filepath)
205 throw createMismatchError(
206 result.message(),
207 snapshotState.expand,
208 result.actual,
209 result.expected,
210 )
211 }
212 }
213
214 matchDomain(options: AssertDomainOptions): MatchResult {
215 const {

Callers 5

assertRawMethod · 0.95
JestChaiExpectFunction · 0.80
runner.test.tsFile · 0.80
trace.test.tsFile · 0.80

Calls 3

matchMethod · 0.95
getSnapshotStateMethod · 0.95
createMismatchErrorFunction · 0.85

Tested by

no test coverage detected