mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 14:52:01 +03:00
26 lines
756 B
TypeScript
26 lines
756 B
TypeScript
/** @file Configuration for vitest. */
|
|
import * as url from 'node:url'
|
|
|
|
import * as vitestConfig from 'vitest/config'
|
|
|
|
import * as appConfig from 'enso-common/src/appConfig'
|
|
|
|
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
|
|
|
|
export default vitestConfig.mergeConfig(
|
|
VITE_CONFIG,
|
|
vitestConfig.defineConfig({
|
|
test: {
|
|
environment: 'jsdom',
|
|
exclude: [...vitestConfig.configDefaults.exclude, '**/*.spec.{ts,tsx}'],
|
|
root: url.fileURLToPath(new URL('./', import.meta.url)),
|
|
restoreMocks: true,
|
|
},
|
|
}),
|
|
)
|