2024-08-04 08:28:19 +08:00
|
|
|
import path from 'node:path';
|
2024-08-20 07:41:08 +08:00
|
|
|
import dotenv from 'dotenv';
|
2024-07-23 16:25:11 +08:00
|
|
|
import { defineConfig } from 'vitest/config';
|
2025-01-07 11:10:28 +08:00
|
|
|
import { version } from './package.json';
|
2024-07-23 16:25:11 +08:00
|
|
|
|
2024-08-20 07:41:08 +08:00
|
|
|
/**
|
|
|
|
* Read environment variables from file.
|
|
|
|
* https://github.com/motdotla/dotenv
|
|
|
|
*/
|
|
|
|
dotenv.config({
|
|
|
|
path: path.join(__dirname, '../../.env'),
|
|
|
|
});
|
2024-08-01 15:46:40 +08:00
|
|
|
|
2025-03-26 18:59:50 +08:00
|
|
|
const testFiles = ['tests/ai/web/**/*.test.ts', 'tests/ai/bridge/**/*.test.ts'];
|
2024-08-01 15:46:40 +08:00
|
|
|
|
2024-07-23 16:25:11 +08:00
|
|
|
export default defineConfig({
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'@': path.resolve(__dirname, 'src'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
test: {
|
2024-09-06 17:19:35 +08:00
|
|
|
include: testFiles,
|
2025-02-14 21:54:47 +08:00
|
|
|
testTimeout: 3 * 60 * 1000, // Global timeout set to 10 seconds
|
2025-03-12 13:49:50 +08:00
|
|
|
dangerouslyIgnoreUnhandledErrors: !!process.env.CI, // showcase.test.ts is not stable
|
2024-07-23 16:25:11 +08:00
|
|
|
},
|
2025-01-07 11:10:28 +08:00
|
|
|
define: {
|
|
|
|
__VERSION__: `'${version}'`,
|
|
|
|
},
|
2024-07-23 16:25:11 +08:00
|
|
|
});
|