resolveSnapshotPath
- Type:
(testPath: string, snapExtension: string) => string - Default:
undefined
Customize where Rstest stores snapshot files.
This is a global option set in the root config and cannot be overridden per project in projects.
By default, Rstest saves snapshot files in a __snapshots__ directory next to each test file. Return a custom path from resolveSnapshotPath to change this location.
For example, store snapshots beside test files instead of inside __snapshots__:
rstest.config.ts