MCPcopy Create free account
hub / github.com/vitest-dev/vitest / readSnapshotFile

Function readSnapshotFile

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

Source from the content-addressed store, hash-verified

258 vitest.snapshot.add(snapshot)
259 },
260 async readSnapshotFile(snapshotPath) {
261 checkFileAccess(snapshotPath)
262 if (!existsSync(snapshotPath)) {
263 return null
264 }
265 return fs.readFile(snapshotPath, 'utf-8')
266 },
267 async saveSnapshotFile(id, content) {
268 checkFileAccess(id)
269 if (!canWrite(project)) {

Callers

nothing calls this directly

Calls 2

checkFileAccessFunction · 0.85
readFileMethod · 0.80

Tested by

no test coverage detected