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

Function updateSnapshot

packages/vitest/src/api/setup.ts:161–173  ·  view source on GitHub ↗
(file?: File)

Source from the content-addressed store, hash-verified

159 return getModuleGraph(ctx, project, id, browser)
160 },
161 async updateSnapshot(file?: File) {
162 // silently ignore exec/write attempts if not allowed
163 // this function both executes the code and write snapshots
164 if (!ctx.config.api.allowExec || !ctx.config.api.allowWrite) {
165 return
166 }
167 if (!file) {
168 await ctx.updateSnapshot()
169 }
170 else {
171 await ctx.updateSnapshot([file.filepath])
172 }
173 },
174 getUnhandledErrors() {
175 return ctx.state.getUnhandledErrors()
176 },

Callers

nothing calls this directly

Calls 1

updateSnapshotMethod · 0.80

Tested by

no test coverage detected