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

Method create

packages/snapshot/src/port/state.ts:124–132  ·  view source on GitHub ↗
(testFilePath: string, options: SnapshotStateOptions)

Source from the content-addressed store, hash-verified

122 }
123
124 static async create(testFilePath: string, options: SnapshotStateOptions): Promise<SnapshotState> {
125 const snapshotPath = await options.snapshotEnvironment.resolvePath(
126 testFilePath,
127 )
128 const content = await options.snapshotEnvironment.readSnapshotFile(
129 snapshotPath,
130 )
131 return new SnapshotState(testFilePath, snapshotPath, content, options)
132 }
133
134 get snapshotUpdateState(): SnapshotUpdateState {
135 return this._updateSnapshot

Callers 15

index.tsFile · 0.80
resolveOptionsFunction · 0.80
generateReportsMethod · 0.80
cloneFunction · 0.80
serializeValueFunction · 0.80
taskFunction · 0.80
initSuiteFunction · 0.80
suiteFnFunction · 0.80
getFileContextMethod · 0.80
getWorkerContextMethod · 0.80
createFileTaskFunction · 0.80
generateReportsMethod · 0.80

Calls 2

resolvePathMethod · 0.45
readSnapshotFileMethod · 0.45

Tested by

no test coverage detected