import { defineConfig } from 'vitest/config';
import path from 'node:path';

export default defineConfig({
  test: {
    include: ['tests/**/*.test.ts'],
    globals: false,
    environment: 'node',
    // Tests that touch the DB pull a fresh schema into a temp file in a
    // beforeAll hook (see tests/helpers/db.ts). Single fork so distinct
    // test files don't trample each other on the same `app.db` path
    // resolution.
    pool: 'forks',
    forks: { singleFork: true },
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, '.'),
    },
  },
});
