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'
|
|
|
|
|
|
|
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
|
|
|
|
|
|
appConfig.loadTestEnvironmentVariables()
|
|
|
|
// @ts-expect-error This is required, otherwise importing node modules is broken.
|
|
|
|
// This is required for `dataLinkSchema.test.ts`.
|
|
|
|
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-01-08 15:58:09 +03:00
|
|
|
exclude: ['**/*.spec.{ts,tsx}'],
|
|
|
|
root: url.fileURLToPath(new URL('./', import.meta.url)),
|
|
|
|
restoreMocks: true,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
)
|