vitest/docs/config/resolvesnapshotpath.md
2025-11-06 14:59:05 +01:00

534 B

title outline
resolveSnapshotPath | Config deep

resolveSnapshotPath

  • Type: (testPath: string, snapExtension: string, context: { config: SerializedConfig }) => string
  • Default: stores snapshot files in __snapshots__ directory

Overrides default snapshot path. For example, to store snapshots next to test files:

import { defineConfig } from 'vitest/config'

export default defineConfig({
  test: {
    resolveSnapshotPath: (testPath, snapExtension) => testPath + snapExtension,
  },
})