Files
bsk/package.json
T
tiennm99 5ddf11ac4a test: add Vitest unit + Playwright E2E suites (PLAN §7)
The repo had zero tests despite PLAN §7 mandating them.

- 97 unit tests over the pure logic: checkup/customer/catalog/template Zod
  schemas, parseNum, computeAge, and invoice math
- extracted lib/billing/totals.ts (sumLineTotals/formatVnd) so invoice math is
  testable, and refactored the invoice route + dashboard to use it
- 16 Playwright smoke tests that need no database: auth gates redirect to
  sign-in, VI-default rendering, password-reveal toggle, /en locale, 404
- playwright.config passes placeholder env inline via webServer.env so no
  env file is ever needed; pnpm test wired into CI (E2E stays local)

tests/e2e/README.md documents the seeded-data prerequisites for the full
queue -> checkup -> prescription -> paid -> invoice happy path, which is
blocked on a provisioned Supabase project rather than faked with skipped tests.
2026-07-25 15:16:48 +07:00

72 lines
2.2 KiB
JSON

{
"name": "bsk",
"version": "0.1.0",
"private": true,
"packageManager": "pnpm@11.1.1",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"format": "prettier --write .",
"format:check": "prettier --check .",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"test:e2e": "playwright test",
"db:preflight": "tsx scripts/preflight-supabase.ts",
"db:push": "pnpm db:preflight && supabase db push",
"db:gen-types": "supabase gen types typescript --schema bsk > types/supabase-bsk.ts",
"db:seed-geo": "tsx scripts/seed-geo.ts",
"check:no-secret-leak": "node scripts/check-no-secret-leak.mjs"
},
"dependencies": {
"@hookform/resolvers": "^5.4.0",
"@react-pdf/renderer": "^4.5.1",
"@supabase/ssr": "^0.10.3",
"@supabase/supabase-js": "^2.106.1",
"@tanstack/react-table": "^8.21.3",
"@upstash/qstash": "^2.11.0",
"@upstash/ratelimit": "^2.0.8",
"@upstash/redis": "^1.38.0",
"bwip-js": "^4.11.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"date-fns": "^4.3.0",
"date-fns-tz": "^3.2.0",
"lucide-react": "^0.546.0",
"next": "^16.2.11",
"next-intl": "^4.12.0",
"next-themes": "^0.4.6",
"radix-ui": "^1.4.3",
"react": "^19.2.6",
"react-dom": "^19.2.6",
"react-hook-form": "^7.76.1",
"recharts": "^3.10.0",
"sonner": "^2.0.7",
"tailwind-merge": "^3.6.0",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
"zod": "^4.4.3"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.5",
"@playwright/test": "^1.61.1",
"@tailwindcss/postcss": "^4.3.0",
"@types/node": "^22.10.0",
"@types/react": "^19.2.15",
"@types/react-dom": "^19.2.3",
"@vitest/coverage-v8": "^4.1.10",
"eslint": "^9.36.0",
"eslint-config-next": "^16.2.6",
"eslint-config-prettier": "^10.1.8",
"postcss": "^8.5.15",
"prettier": "^3.8.3",
"prettier-plugin-tailwindcss": "^0.8.0",
"tailwindcss": "^4.3.0",
"tsx": "^4.22.3",
"typescript": "^5.9.2",
"vitest": "^4.1.10"
}
}