2024-01-08 15:58:09 +03:00
|
|
|
/** @file Configuration for vitest. */
|
|
|
|
import * as url from 'node:url'
|
2024-01-10 19:22:11 +03:00
|
|
|
|
2024-01-08 15:58:09 +03:00
|
|
|
import * as vitestConfig from 'vitest/config'
|
2024-01-10 19:22:11 +03:00
|
|
|
|
2024-04-29 10:27:00 +03:00
|
|
|
import * as appConfig from 'enso-common/src/appConfig'
|
|
|
|
|
|
|
|
appConfig.loadTestEnvironmentVariables()
|
|
|
|
// @ts-expect-error This is required, otherwise importing node modules is broken.
|
2024-05-20 11:45:55 +03:00
|
|
|
// This is required for `datalinkSchema.test.ts`.
|
2024-04-29 10:27:00 +03:00
|
|
|
process.env.NODE_ENV = 'development'
|
|
|
|
|
|
|
|
const VITE_CONFIG = (await import('./vite.config')).default
|
2024-01-08 15:58:09 +03:00
|
|
|
|
|
|
|
export default vitestConfig.mergeConfig(
|
2024-04-29 10:27:00 +03:00
|
|
|
VITE_CONFIG,
|
2024-01-08 15:58:09 +03:00
|
|
|
vitestConfig.defineConfig({
|
|
|
|
test: {
|
2024-01-09 13:43:18 +03:00
|
|
|
environment: 'jsdom',
|
2024-07-05 14:13:04 +03:00
|
|
|
exclude: [...vitestConfig.configDefaults.exclude, '**/*.spec.{ts,tsx}'],
|
2024-01-08 15:58:09 +03:00
|
|
|
root: url.fileURLToPath(new URL('./', import.meta.url)),
|
|
|
|
restoreMocks: true,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
)
|