feat: add Vitest unit tests for utility functions

- Set up Vitest with 27 tests across 3 test suites
- relativeTime: edge cases, time buckets, future timestamps
- sessionDisplayName: labels, kinds, channels, UUID truncation
- messagesToMarkdown: roles, blocks, tool calls, system events
- Add test and test:watch npm scripts
- Add test step to CI workflow
This commit is contained in:
Nicolas Varrot
2026-02-13 06:58:39 +00:00
parent f05db6aa6d
commit c4725e65c2
6 changed files with 558 additions and 2 deletions

View File

@@ -30,6 +30,8 @@
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"test": "vitest run",
"test:watch": "vitest",
"preview": "vite preview",
"lint:fix": "eslint . --fix"
},
@@ -63,7 +65,8 @@
"globals": "^16.5.0",
"typescript": "~5.9.3",
"typescript-eslint": "^8.48.0",
"vite": "^7.3.1"
"vite": "^7.3.1",
"vitest": "^4.0.18"
},
"engines": {
"node": ">=18"