From 03d55276a6e1aa67fc7b69e19b8d73b5b67e3bab Mon Sep 17 00:00:00 2001 From: Lukas May Date: Fri, 30 Jan 2026 13:53:00 +0100 Subject: [PATCH] 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 --- package.json | 13 ++++++++++--- vitest.config.ts | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 vitest.config.ts diff --git a/package.json b/package.json index 2c04f49..e51b0cb 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,10 @@ "scripts": { "build": "tsc", "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": [ "claude", @@ -21,13 +24,17 @@ "author": "", "license": "ISC", "dependencies": { + "@trpc/server": "^11.9.0", "commander": "^12.1.0", - "execa": "^9.5.2" + "execa": "^9.5.2", + "zod": "^4.3.6" }, "devDependencies": { + "@trpc/client": "^11.9.0", "@types/node": "^22.10.7", "rimraf": "^6.0.1", "tsx": "^4.19.2", - "typescript": "^5.7.3" + "typescript": "^5.7.3", + "vitest": "^4.0.18" } } diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..920ba58 --- /dev/null +++ b/vitest.config.ts @@ -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'], + }, + }, +});