new/.config/vitest.config.mts
raw| 1 | import { defineConfig } from 'vitest/config'; |
| 2 | import path from 'node:path'; |
| 3 | |
| 4 | export default defineConfig({ |
| 5 | test: { |
| 6 | // Store snapshots next to each test in a .snapshots folder |
| 7 | resolveSnapshotPath: (testPath, snapExt) => |
| 8 | path.join(path.dirname(testPath), '.snapshots', path.basename(testPath) + snapExt) |
| 9 | }, |
| 10 | resolve: { |
| 11 | // Allow importing the current package under test via `~package` |
| 12 | alias: [{ find: /^~package$/, replacement: path.resolve(process.cwd()) }] |
| 13 | } |
| 14 | }); |