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

Method probeExpectedSnapshot

packages/snapshot/src/port/state.ts:450–465  ·  view source on GitHub ↗
(
    options: Pick<SnapshotMatchOptions, 'testName' | 'testId' | 'isInline' | 'inlineSnapshot'>,
  )

Source from the content-addressed store, hash-verified

448 }
449
450 probeExpectedSnapshot(
451 options: Pick<SnapshotMatchOptions, 'testName' | 'testId' | 'isInline' | 'inlineSnapshot'>,
452 ): ExpectedSnapshot {
453 const count = this._counters.get(options.testName) + 1
454 const key = testNameToKey(options.testName, count)
455 return {
456 key,
457 count,
458 data: options?.isInline ? options.inlineSnapshot : this._snapshotData[key],
459 markAsChecked: () => {
460 this._counters.increment(options.testName)
461 this._testIdToKeys.get(options.testId).push(key)
462 this._uncheckedKeys.delete(key)
463 },
464 }
465 }
466
467 match({
468 testId,

Callers 3

matchMethod · 0.80
matchDomainMethod · 0.80
pollMatchDomainMethod · 0.80

Calls 4

testNameToKeyFunction · 0.90
incrementMethod · 0.80
getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected