({
__dirname: dirname,
}: {
__dirname: string;
})
| 6 | const rootTestSetup = (dirname: string) => path.resolve(dirname, '../../test/test-setup.ts'); |
| 7 | |
| 8 | export const getSharedVitestConfig = ({ |
| 9 | __dirname: dirname, |
| 10 | }: { |
| 11 | __dirname: string; |
| 12 | }) => { |
| 13 | return defineConfig({ |
| 14 | resolve: { |
| 15 | alias: { |
| 16 | '@': path.resolve(dirname, 'src'), |
| 17 | }, |
| 18 | }, |
| 19 | test: { |
| 20 | setupFiles: [rootTestSetup(dirname)], |
| 21 | env: { |
| 22 | // Always point at local Docker — never production, regardless of .env |
| 23 | DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/postgres?schema=public', |
| 24 | CLICKHOUSE_URL: 'http://localhost:8123/openpanel', |
| 25 | REDIS_URL: 'redis://localhost:6379', |
| 26 | SELF_HOSTED: 'true', |
| 27 | }, |
| 28 | include: ['**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], |
| 29 | browser: { |
| 30 | name: 'chromium', |
| 31 | provider: 'playwright', |
| 32 | headless: true, |
| 33 | }, |
| 34 | fakeTimers: { toFake: undefined }, |
| 35 | }, |
| 36 | }); |
| 37 | }; |
no test coverage detected