2024-02-19 10:03:51 -07:00
|
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
|
2024-02-29 13:10:08 -07:00
|
|
|
// skip `docker compose up` if `make e2e` was already run
|
2024-07-11 04:55:00 -07:00
|
|
|
const globalSetup: string[] = ['src/setup/auth-server.ts'];
|
2024-02-29 13:10:08 -07:00
|
|
|
try {
|
2024-08-30 05:04:02 -07:00
|
|
|
await fetch('http://127.0.0.1:2285/api/server-info/ping');
|
2024-02-29 13:10:08 -07:00
|
|
|
} catch {
|
2024-07-11 04:55:00 -07:00
|
|
|
globalSetup.push('src/setup/docker-compose.ts');
|
2024-02-29 13:10:08 -07:00
|
|
|
}
|
|
|
|
|
2024-02-19 10:03:51 -07:00
|
|
|
export default defineConfig({
|
|
|
|
test: {
|
2024-04-17 05:27:04 -07:00
|
|
|
include: ['src/{api,cli,immich-admin}/specs/*.e2e-spec.ts'],
|
2024-02-29 13:10:08 -07:00
|
|
|
globalSetup,
|
2024-04-12 12:15:41 -07:00
|
|
|
testTimeout: 15_000,
|
2024-07-31 08:26:35 -07:00
|
|
|
pool: 'threads',
|
2024-02-19 10:03:51 -07:00
|
|
|
poolOptions: {
|
|
|
|
threads: {
|
|
|
|
singleThread: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|