test: add Vitest and Playwright testing infrastructure

- Add Vitest for unit tests (39 tests)
  - cached-responses.test.ts
  - ai-providers.test.ts
  - chat-helpers.test.ts
  - utils.test.ts
- Add Playwright for E2E tests (3 smoke tests)
  - Homepage load
  - Japanese locale
  - Settings dialog
- Add CI workflow (.github/workflows/test.yml)
- Add vitest.config.mts and playwright.config.ts
- Update .gitignore for test artifacts
This commit is contained in:
dayuan.jiang
2026-01-04 19:33:02 +09:00
parent 3ce047f794
commit 74fbb629e7
11 changed files with 1998 additions and 9 deletions

11
vitest.config.mts Normal file
View File

@@ -0,0 +1,11 @@
import { defineConfig } from "vitest/config"
import react from "@vitejs/plugin-react"
import tsconfigPaths from "vite-tsconfig-paths"
export default defineConfig({
plugins: [tsconfigPaths(), react()],
test: {
environment: "jsdom",
include: ["tests/**/*.test.{ts,tsx}"],
},
})