pokerogue/vitest.config.js
Devin Korb 53def01b51
Add unit testing support with vitest (#18)
* update loose files and add vitest

* update test scripts

* more support for vitest

* more test support

* update vscode settings
2024-03-30 20:47:47 -04:00

41 lines
777 B
JavaScript

import { defineConfig } from 'vite';
// import fs from 'vite-plugin-fs';
export default defineConfig(({ mode }) => {
return {
test: {
setupFiles: ['./src/test/vitest.setup.ts'],
environment: 'jsdom',
deps: {
optimizer: {
web: {
include: ['vitest-canvas-mock'],
}
}
},
threads: false,
environmentOptions: {
jsdom: {
resources: 'usable',
},
},
coverage: {
provider: 'istanbul',
reportsDirectory: 'coverage',
reporters: ['text-summary', 'html'],
},
},
plugins: [/*fs()*/],
server: { host: '0.0.0.0', port: 8000 },
clearScreen: false,
build: {
minify: 'esbuild',
sourcemap: true
},
esbuild: {
pure: mode === 'production' ? [ 'console.log' ] : [],
keepNames: true,
},
}
})