Skip to content

Commit 767a683

Browse files
Reverseanclaude
authored andcommitted
chore: bootstrap vitest + vue-test-utils
notes.web had no test setup at all. Vitest requires Vite >=5, so bump vite 4->6 and @vitejs/plugin-vue 4->5; vue-tsc stays at 1.8.8 since 3.x surfaces unrelated pre-existing errors in @codexteam/ui. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent a1cb5ec commit 767a683

5 files changed

Lines changed: 1674 additions & 196 deletions

File tree

package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
"lint": "eslint",
1313
"lint:fix": "yarn lint --fix",
1414
"watch-ts": "vue-tsc --noEmit --watch",
15-
"format": "prettier --write --cache ."
15+
"format": "prettier --write --cache .",
16+
"test": "vitest run",
17+
"test:dev": "vitest",
18+
"coverage": "vitest run --coverage"
1619
},
1720
"private": true,
1821
"workspaces": [
@@ -38,16 +41,19 @@
3841
"devDependencies": {
3942
"@eslint/eslintrc": "^3.1.0",
4043
"@eslint/js": "^9.3.0",
41-
"@hawk.so/vite-plugin": "^1.0.2",
44+
"@hawk.so/vite-plugin": "^1.0.6",
4245
"@types/node": "^20.10.7",
43-
"@vitejs/plugin-vue": "^4.1.0",
46+
"@vitejs/plugin-vue": "^5.2.4",
47+
"@vitest/coverage-v8": "^4.1.10",
48+
"@vue/test-utils": "^2.4.11",
4449
"eslint": "^9.3.0",
4550
"eslint-config-codex": "^2.0.0",
4651
"eslint-config-prettier": "^9.1.0",
4752
"eslint-import-resolver-typescript": "^3.5.5",
4853
"eslint-plugin-boundaries": "^3.1.1",
4954
"eslint-plugin-prettier-vue": "^5.0.0",
5055
"eslint-plugin-vue": "^9.15.1",
56+
"happy-dom": "^20.11.1",
5157
"postcss": "^8.4.26",
5258
"postcss-apply": "^0.12.0",
5359
"postcss-hover-media-feature": "^1.0.2",
@@ -56,7 +62,8 @@
5662
"prettier": "3.2.5",
5763
"typescript": "^5.4.5",
5864
"typescript-eslint": "^7.9.0",
59-
"vite": "^4.4.9",
65+
"vite": "^6.4.3",
66+
"vitest": "^4.1.10",
6067
"vue-eslint-parser": "9.4.2",
6168
"vue-tsc": "^1.8.8"
6269
},

tsconfig.eslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"src/**/*.ts",
55
"src/**/*.vue",
66
"vite.config.ts",
7+
"vitest.config.ts",
78
"eslint.config.mjs",
89
"postcss.config.js",
910
],

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"module": "ESNext",
99
"lib": ["ES2020", "DOM", "DOM.Iterable"],
1010
"skipLibCheck": true,
11-
"moduleResolution": "node",
11+
"moduleResolution": "bundler",
1212
"allowImportingTsExtensions": true,
1313
"resolveJsonModule": true,
1414
"isolatedModules": true,

vitest.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { defineConfig } from 'vitest/config';
2+
import vue from '@vitejs/plugin-vue';
3+
import { fileURLToPath } from 'node:url';
4+
5+
export default defineConfig({
6+
plugins: [vue()],
7+
test: {
8+
environment: 'happy-dom',
9+
coverage: {
10+
reporter: ['text', 'json-summary', 'json'],
11+
reportOnFailure: true,
12+
},
13+
},
14+
resolve: {
15+
alias: {
16+
/* eslint-disable-next-line @typescript-eslint/naming-convention */
17+
'@/': fileURLToPath(new URL('./src/', import.meta.url)),
18+
},
19+
},
20+
});

0 commit comments

Comments
 (0)