test: add Vitest configuration and setup

- Add vitest.config.ts with jsdom environment and path aliases
- Add tests/setup.ts with mocks for Tauri API, crypto, and localStorage
- Add test:coverage script to package.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-03-21 16:55:44 +08:00
parent 9fc17e9d36
commit 2c80a2c3c2
3 changed files with 113 additions and 0 deletions

View File

@@ -22,6 +22,7 @@
"tauri:build:msi:debug": "pnpm prepare:openfang-runtime && node scripts/tauri-build-bundled.mjs --debug --bundles msi",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"test:e2e": "playwright test --project chromium --config=tests/e2e/playwright.config.ts",
"test:e2e:ui": "playwright test --project chromium-ui --config=tests/e2e/playwright.config.ts --grep 'UI'",
"test:e2e:headed": "playwright test --project chromium-headed --headed",