Files
technitium-console/vitest.config.ts
T
DenozordecandClaude Sonnet 5.5 ea98a33b25
CI / check (push) Successful in 3m23s
CI / image (push) Successful in 1m55s
Tests: a 20 s timeout for the slower CI runner
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 09:54:59 +07:00

24 lines
993 B
TypeScript

import { readFileSync } from 'node:fs'
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
/* The build injects this from package.json (see vite.config.ts). The tests run
through a different config, so it has to be injected here as well or anything
that reports the console's own version throws. */
const version = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')).version
export default defineConfig({
plugins: [react()],
resolve: { alias: { '@': new URL('./src', import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, '$1') } },
define: { __CONSOLE_VERSION__: JSON.stringify(version) },
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./src/test/setup.ts'],
/* jsdom with ReUI's popovers is slow on a shared CI runner: a test that opens three
menus in a row took more than the default 5 s there while taking about one here. */
testTimeout: 20000,
hookTimeout: 20000,
},
})