chore(01.1-01): install and configure Vitest test framework

- Add vitest as dev dependency
- Create vitest.config.ts with globals, TypeScript support, coverage
- Add npm scripts: test, test:watch, test:coverage
This commit is contained in:
Lukas May
2026-01-30 13:53:00 +01:00
parent 655fc296b6
commit 03d55276a6
2 changed files with 26 additions and 3 deletions

View File

@@ -10,7 +10,10 @@
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"dev": "tsx watch src/bin/cw.ts", "dev": "tsx watch src/bin/cw.ts",
"clean": "rimraf dist" "clean": "rimraf dist",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage"
}, },
"keywords": [ "keywords": [
"claude", "claude",
@@ -21,13 +24,17 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@trpc/server": "^11.9.0",
"commander": "^12.1.0", "commander": "^12.1.0",
"execa": "^9.5.2" "execa": "^9.5.2",
"zod": "^4.3.6"
}, },
"devDependencies": { "devDependencies": {
"@trpc/client": "^11.9.0",
"@types/node": "^22.10.7", "@types/node": "^22.10.7",
"rimraf": "^6.0.1", "rimraf": "^6.0.1",
"tsx": "^4.19.2", "tsx": "^4.19.2",
"typescript": "^5.7.3" "typescript": "^5.7.3",
"vitest": "^4.0.18"
} }
} }

16
vitest.config.ts Normal file
View File

@@ -0,0 +1,16 @@
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// Enable test globals (describe, it, expect without imports)
globals: true,
// Test file pattern
include: ['**/*.test.ts'],
// TypeScript support uses tsconfig.json automatically
// Coverage reporter (optional, for future use)
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
},
},
});