mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
22 lines
534 B
Markdown
22 lines
534 B
Markdown
---
|
|
title: resolveSnapshotPath | Config
|
|
outline: deep
|
|
---
|
|
|
|
# resolveSnapshotPath <CRoot />
|
|
|
|
- **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:
|
|
|
|
```ts
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
resolveSnapshotPath: (testPath, snapExtension) => testPath + snapExtension,
|
|
},
|
|
})
|
|
```
|