refactor: switch from jsdom to happy-dom

This commit is contained in:
2025-02-16 23:59:00 +08:00
parent ba13828093
commit 41f2b04c45
8 changed files with 124 additions and 89 deletions

View File

@@ -6,7 +6,7 @@ export default defineConfig({
cacheDir: '.vitest',
test: {
setupFiles: ['src/testing/init-test.ts'],
environment: 'jsdom',
environment: 'happy-dom',
include: ['src/**/*.spec.ts'],
globals: true,
restoreMocks: true,
@@ -15,6 +15,14 @@ export default defineConfig({
reporter: ['text', 'json-summary', 'json'],
// If you want a coverage reports even if your tests are failing, include the reportOnFailure option
reportOnFailure: true,
exclude: [
'vitest.config.ts',
'playwright.config.ts',
'rslib.config.ts',
'scripts/**',
'examples/**',
'dist/**',
],
},
},
plugins: [