Migrate from Jest to Vitest

This migrates our tests from using the Jest testing framework to Vitest.
This commit is contained in:
regexowl 2024-06-24 08:44:06 +02:00 committed by Ondřej Ezr
parent ac60043199
commit da16a42128
8 changed files with 1891 additions and 168 deletions

31
vitest.config.ts Normal file
View file

@ -0,0 +1,31 @@
import react from '@vitejs/plugin-react';
const config = {
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/test/setup.ts'],
coverage: {
provider: 'v8',
reporter: 'text',
},
server: {
deps: {
inline: ['@patternfly', 'clsx'],
},
},
fileParallelism: false,
testTimeout: 10000,
},
resolve: {
mainFields: ['module'],
},
esbuild: {
loader: 'tsx',
include: /src\/.*\.[tj]sx?$/,
exclude: [],
},
};
export default config;