forgejo/vitest.config.js
silverwind f8060bb5d9
Switch to happy-dom for testing (#29948)
Use `happy-dom` again in vitest as it has caught up recently to `jsdom`
in terms of features and it is a much more lightweight solution.

I encountered [one
bug](https://github.com/capricorn86/happy-dom/issues/1342), but it's an
easy workaround until fixed.

I regenerated the lockfile to get rid of the transitive dependencies so
that's why the diff also has some upgrades in it.

In total, this change removes 39 npm dependencies.

(cherry picked from commit 82979588f4d8699097451ebb70c56a4bdd090c52)
2024-03-26 19:04:26 +01:00

22 lines
485 B
JavaScript

import {defineConfig} from 'vitest/config';
import vuePlugin from '@vitejs/plugin-vue';
import {stringPlugin} from 'vite-string-plugin';
export default defineConfig({
test: {
include: ['web_src/**/*.test.js'],
setupFiles: ['web_src/js/vitest.setup.js'],
environment: 'happy-dom',
testTimeout: 20000,
open: false,
allowOnly: true,
passWithNoTests: true,
globals: true,
watch: false,
},
plugins: [
stringPlugin(),
vuePlugin(),
],
});