2025-12-10 08:36:37 +00:00
|
|
|
import { defaultExclude, defineConfig } from 'vitest/config';
|
2023-02-10 10:11:23 +00:00
|
|
|
|
2024-07-15 11:21:23 +00:00
|
|
|
const setupFiles = ['../scripts/serializer.ts', './expect.ts'];
|
|
|
|
|
|
|
|
|
|
if (!process.env.RUN_AGAINST_LOCAL_SERVICES) {
|
|
|
|
|
setupFiles.unshift('dotenv/config');
|
|
|
|
|
} else {
|
|
|
|
|
setupFiles.unshift('./local-dev.ts');
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-10 10:11:23 +00:00
|
|
|
export default defineConfig({
|
|
|
|
|
test: {
|
|
|
|
|
globals: true,
|
|
|
|
|
alias: {
|
2024-05-22 07:55:27 +00:00
|
|
|
'testkit/gql/graphql': new URL('./testkit/gql/graphql.ts', import.meta.url).pathname,
|
2025-11-16 09:38:27 +00:00
|
|
|
'testkit/graphql': new URL('./testkit/graphql.ts', import.meta.url).pathname,
|
2024-05-22 07:55:27 +00:00
|
|
|
'testkit/gql': new URL('./testkit/gql/index.ts', import.meta.url).pathname,
|
2025-11-16 09:38:27 +00:00
|
|
|
'testkit/flow': new URL('./testkit/flow.ts', import.meta.url).pathname,
|
|
|
|
|
'testkit/utils': new URL('./testkit/utils.ts', import.meta.url).pathname,
|
|
|
|
|
'testkit/seed': new URL('./testkit/seed.ts', import.meta.url).pathname,
|
|
|
|
|
'testkit/auth': new URL('./testkit/auth.ts', import.meta.url).pathname,
|
|
|
|
|
'testkit/usage': new URL('./testkit/usage.ts', import.meta.url).pathname,
|
|
|
|
|
'testkit/registry-models': new URL('./testkit/registry-models.ts', import.meta.url).pathname,
|
|
|
|
|
'testkit/mock-server': new URL('./testkit/mock-server.ts', import.meta.url).pathname,
|
2024-04-07 08:57:03 +00:00
|
|
|
'@hive/service-common': new URL(
|
|
|
|
|
'../packages/services/service-common/src/index.ts',
|
|
|
|
|
import.meta.url,
|
|
|
|
|
).pathname,
|
2026-02-23 10:19:12 +00:00
|
|
|
'@hive/server/supertokens-at-home/shared': new URL(
|
|
|
|
|
'../packages/services/server/src/supertokens-at-home/shared.ts',
|
|
|
|
|
import.meta.url,
|
|
|
|
|
).pathname,
|
|
|
|
|
'@hive/api/modules/auth/lib/supertokens-at-home/crypto': new URL(
|
|
|
|
|
'../packages/services/api/src/modules/auth/lib/supertokens-at-home/crypto.ts',
|
|
|
|
|
import.meta.url,
|
|
|
|
|
).pathname,
|
2023-02-10 10:11:23 +00:00
|
|
|
},
|
2024-07-15 11:21:23 +00:00
|
|
|
setupFiles,
|
2023-02-10 10:11:23 +00:00
|
|
|
testTimeout: 90_000,
|
2026-04-15 08:50:18 +00:00
|
|
|
exclude: defaultExclude,
|
2023-02-10 10:11:23 +00:00
|
|
|
},
|
|
|
|
|
});
|