Add Vitest tests for the languages, router, footer and pages, and a lint:check script

This commit is contained in:
Starystars67
2026-10-08 21:42:28 +01:00
parent 9f20c38abe
commit 77c1d01025
11 changed files with 2095 additions and 6 deletions
+25
View File
@@ -0,0 +1,25 @@
import { defineConfig } from 'vite'
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue'
// Tailwind's plugin is left out on purpose: the tests check what a page says
// and links to, not how it looks.
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
test: {
environment: 'jsdom',
environmentOptions: {
jsdom: { url: 'http://localhost:5173' },
},
globals: true,
setupFiles: ['./tests/setup.js'],
// The first test to mount a big view pays for compiling it too.
testTimeout: 20000,
hookTimeout: 20000,
},
})