Run Tests
Execute the test suite for the Pitfal Solutions website.
Arguments
$ARGUMENTS- Optional mode:unit,e2e,coverage,watch,changed, or empty for all tests
Test Modes
Run All Tests (Default)
pnpm testUnit/Component Tests Only
pnpm testE2E Tests (Playwright)
pnpm test:e2eE2E Tests with UI
pnpm test:e2e:uiWatch Mode (Development)
pnpm test:watchChanged Files Only (For Pre-Commit)
pnpm test:changedCoverage Report
pnpm test:coverageCoverage Thresholds
The project enforces 80% coverage thresholds for:
- Lines
- Functions
- Branches
- Statements
If coverage drops below 80%, the test:coverage command will fail.
Test Categories
| Category | Location | Framework |
|---|---|---|
| Unit Tests | src/**/*.test.ts | Vitest |
| Component Tests | src/**/*.test.tsx | Vitest + Testing Library |
| API Tests | lambda/**/*.test.ts | Vitest |
| E2E Tests | tests/e2e/*.spec.ts | Playwright |
Pre-Commit Workflow
Before committing code:
pnpm test:changed # Tests for changed files only
pnpm lint # Lint check
pnpm type-check # TypeScript checkCI Workflow
Full test suite for CI/CD:
pnpm test # Full test suite
pnpm test:coverage # Coverage report
pnpm test:e2e # E2E testsOutput
Report:
- Test results (pass/fail counts)
- Failed test details with stack traces
- Coverage summary (when using
coveragemode) - Recommendations for next steps