fix: unit test

This commit is contained in:
Maulana Sodiqin
2025-03-16 00:12:15 +07:00
parent 587cb9facf
commit ec02a4ef83
5 changed files with 754 additions and 4 deletions
+2 -1
View File
@@ -7,7 +7,8 @@
"vitest/importMeta",
"vite/client",
"node",
"vitest"
"vitest",
"@testing-library/jest-dom"
]
},
"include": [
+3 -2
View File
@@ -51,9 +51,10 @@ export default defineConfig(() => ({
},
test: {
watch: false,
globals: true,
setupFiles: ['./vitest.setup.ts'],
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
globalsSetup: './vitest.setup.ts',
globals: true,
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: {
+8 -1
View File
@@ -1 +1,8 @@
import '@testing-library/jest-dom';
import { afterEach } from 'vitest';
import { cleanup } from '@testing-library/react';
import React from 'react';
import '@testing-library/jest-dom/vitest';
afterEach(() => {
cleanup();
});