Open History to see the last commit
1import { fileURLToPath } from 'node:url'
2import { defineConfig } from 'vitest/config'
3
4// A minimal Node-environment vitest config for the example's unit tests (the
5// SQLite persistence conformance suite, the interrupt route's pure helpers). It
6// deliberately does NOT load the TanStack Start / Nitro plugins from
7// `vite.config.ts` — these tests exercise plain server-side modules and need
8// Node's `node:sqlite`, not the app bundle.
9export default defineConfig({
10 resolve: {
11 // The app's `@/*` -> `src/*` tsconfig path, which the Start plugin supplies
12 // in the real build. Route modules under test import through it.
13 alias: {
14 '@': fileURLToPath(new URL('./src', import.meta.url)),
15 },
16 },
17 test: {
18 name: 'ts-react-chat',
19 environment: 'node',
20 include: ['src/**/*.test.ts'],
21 watch: false,
22 },
23})