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

Method setup

packages/snapshot/src/client.ts:83–94  ·  view source on GitHub ↗
(
    filepath: string,
    options: SnapshotStateOptions,
  )

Source from the content-addressed store, hash-verified

81 constructor(private options: SnapshotClientOptions = {}) {}
82
83 async setup(
84 filepath: string,
85 options: SnapshotStateOptions,
86 ): Promise<void> {
87 if (this.snapshotStateMap.has(filepath)) {
88 return
89 }
90 this.snapshotStateMap.set(
91 filepath,
92 await SnapshotState.create(filepath, options),
93 )
94 }
95
96 async finish(filepath: string): Promise<SnapshotResult> {
97 const state = this.getSnapshotState(filepath)

Callers 9

createPreviewUserEventFunction · 0.80
cleanupFunction · 0.80
onBeforeRunSuiteMethod · 0.80
setupBaseEnvironmentFunction · 0.80
onMessageFunction · 0.80
handlerFunction · 0.80
userEvent.test.tsFile · 0.80

Calls 3

createMethod · 0.80
hasMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected