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

Method enableSnapshotUpdate

packages/vitest/src/node/core.ts:1323–1330  ·  view source on GitHub ↗

* Enable the mode that allows updating snapshots when running tests. * This method doesn't run any tests. * * Every test that runs after this method is called will update snapshots. * To disable the mode, call `resetSnapshotUpdate`.

()

Source from the content-addressed store, hash-verified

1321 * To disable the mode, call `resetSnapshotUpdate`.
1322 */
1323 public enableSnapshotUpdate(): void {
1324 this.configOverride.snapshotOptions = {
1325 updateSnapshot: 'all',
1326 // environment is resolved inside a worker thread
1327 snapshotEnvironment: null as any,
1328 }
1329 this.snapshot.options.updateSnapshot = 'all'
1330 }
1331
1332 /**
1333 * Disable the mode that allows updating snapshots when running tests.

Callers 1

updateSnapshotMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected