App Testing
Frontend tests are split into unit tests (Vitest) and end-to-end tests (Playwright).
Local
Install dependencies first:
bash
pnpm installRun unit tests:
bash
pnpm --filter @ezinventory/app test:unitRun unit tests with coverage:
bash
pnpm --filter @ezinventory/app test:coverageRun E2E tests:
bash
pnpm --filter @ezinventory/app testRun focused happy-path E2E:
bash
pnpm --filter @ezinventory/app exec playwright test e2e/happy-path.spec.tsRun E2E tests in headed mode:
bash
pnpm --filter @ezinventory/app test:e2e:headedCI
Workflow: .github/workflows/app-ci.yml
CI sequence:
- Install dependencies with
pnpm install --frozen-lockfile - Prepare Nuxt with
pnpm --filter @ezinventory/app exec nuxt prepare - Run unit tests with coverage (
test:coverage) - Upload
apps/app/coverage/lcov.infoto Codecov (flag=app) - Install Playwright Chromium runtime
- Run E2E tests (
test)
Coverage
Vitest coverage is configured in apps/app/vitest.config.ts:
- provider:
v8 - reporters:
text,lcov - threshold target:
100%for statements, branches, functions, lines
LCOV output for CI upload:
apps/app/coverage/lcov.info