mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-27 01:06:09 +00:00
2f81bd504c
* mock default overrides in test setup * change beforeEach to beforeALl * move some more enums into the enums directory * replace modules that import i18n into overrides with modules that don't * add pre tests and update vitest configs, scripts * replace tabs with spaces * fix vitest server port overlap warning * add missing overrides and clean up workspace config * change test name * include spec files in main test suite
42 lines
877 B
TypeScript
42 lines
877 B
TypeScript
import { defineProject } from 'vitest/config';
|
|
import { defaultConfig } from './vite.config';
|
|
|
|
export default defineProject(({ mode }) => ({
|
|
...defaultConfig,
|
|
test: {
|
|
name: "main",
|
|
include: ["./src/test/**/*.{test,spec}.ts"],
|
|
exclude: ["./src/test/pre.test.ts"],
|
|
setupFiles: ['./src/test/vitest.setup.ts'],
|
|
server: {
|
|
deps: {
|
|
inline: ['vitest-canvas-mock'],
|
|
optimizer: {
|
|
web: {
|
|
include: ['vitest-canvas-mock'],
|
|
}
|
|
}
|
|
}
|
|
},
|
|
environment: 'jsdom' as const,
|
|
environmentOptions: {
|
|
jsdom: {
|
|
resources: 'usable',
|
|
},
|
|
},
|
|
threads: false,
|
|
trace: true,
|
|
restoreMocks: true,
|
|
watch: false,
|
|
coverage: {
|
|
provider: 'istanbul' as const,
|
|
reportsDirectory: 'coverage' as const,
|
|
reporters: ['text-summary', 'html'],
|
|
},
|
|
},
|
|
esbuild: {
|
|
pure: mode === 'production' ? [ 'console.log' ] : [],
|
|
keepNames: true,
|
|
},
|
|
}))
|