Configure vitest library with react testing library and jest-dom

This commit is contained in:
Eric NGUYEN 2022-08-03 14:25:57 +02:00
parent 27a24bad65
commit fef45ef91a
9 changed files with 2380 additions and 10 deletions

View file

@ -1,7 +1,18 @@
/// <reference types="vitest" />
/// <reference types="vite/client" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()]
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/test/setup.ts',
// you might want to disable it, if you don't have tests that rely on CSS
// since parsing CSS is slow
css: false
}
});