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

Function readSnapshotFile

packages/browser/src/node/rpc.ts:247–253  ·  view source on GitHub ↗
(snapshotPath)

Source from the content-addressed store, hash-verified

245 vitest.snapshot.add(snapshot)
246 },
247 async readSnapshotFile(snapshotPath) {
248 checkFileAccess(snapshotPath)
249 if (!existsSync(snapshotPath)) {
250 return null
251 }
252 return fs.readFile(snapshotPath, 'utf-8')
253 },
254 async saveSnapshotFile(id, content) {
255 checkFileAccess(id)
256 if (!canWrite(project)) {

Callers

nothing calls this directly

Calls 2

checkFileAccessFunction · 0.85
readFileMethod · 0.80

Tested by

no test coverage detected