Skip to content
On this page

setSnapshotDirectoryPath

sets snapshots directory path.

Defaults to .pactum/snapshots path

Syntax

js
setSnapshotDirectoryPath(path)

Usage

โœ… Correct Usage

js
settings.setSnapshotDirectoryPath('new/path')

Arguments

> path (string)

Snapshot directory path.

Examples

Normal

js
const { spec, settings } = require('pactum');

settings.setSnapshotDirectoryPath('new/path');

await spec()
  .name('snapshot directory test')
  .get('/api/users/1')
  .expectStatus(200)
  .expectJsonSnapshot();

See Also

Released under the MIT License.