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

Function getErrorDiff

test/core/test/diff.test.ts:346–355  ·  view source on GitHub ↗
(actual: unknown, expected: unknown, options?: DiffOptions)

Source from the content-addressed store, hash-verified

344})
345
346function getErrorDiff(actual: unknown, expected: unknown, options?: DiffOptions): string {
347 try {
348 expect(actual).toEqual(expected)
349 }
350 catch (e) {
351 const error = processError(e, options)
352 return error.diff!
353 }
354 return expect.unreachable()
355}
356
357test('asymmetric matcher with objectContaining - simple case', () => {
358 const actual = {

Callers 1

diff.test.tsFile · 0.85

Calls 1

processErrorFunction · 0.90

Tested by

no test coverage detected