✅ test: add vitest.setup.ts

This commit is contained in:
2024-01-20 09:46:29 +01:00
parent f81de62724
commit a74ac68169
2 changed files with 8 additions and 1 deletions
+3 -1
View File
@@ -5,6 +5,8 @@ import react from '@vitejs/plugin-react-swc'
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom'
globals: true,
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts']
}
})
+5
View File
@@ -0,0 +1,5 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';