Testing Guide
Last Verified: 2026-04-11 (PR #465 Jest 29 + React Testing Library migration; PR #515 auth form locators)Each Equa repository uses a different testing framework. This guide covers how to run tests, how to write new ones, and what coverage is expected.
Testing at a Glance
equa-web Testing
Unit Tests (Jest 29 + React Testing Library)
- Framework: Jest 29 with @testing-library/react 14 for React component testing (migrated from Enzyme in PR #465)
- Config:
jest.setup.jsin project root - Test environment: jsdom
- Test files:
*.test.js,*.test.ts,*.test.tsx - Location: Colocated with source (e.g.,
src/shared/components/button/button.test.js) - Test count: 52 tests passing
equa-web/package.json scripts and Jest config
E2E Tests (Playwright)
- Framework: Playwright 1.58
- Config:
playwright.config.ts - Test directory:
e2e/ - Base URL:
http://localhost:8080 - Key test files:
e2e/google-auth-smoke.spec.ts,e2e/auth-modal-security.spec.ts,e2e/agreements.spec.ts,e2e/regression-fixed-issues.spec.ts,e2e/visual-regression.spec.ts
equa-web/package.json scripts; .github/workflows/e2e-tests.yml
equa-server Testing
Integration Tests (Mocha)
- Framework: Mocha with TypeScript support
- Config:
modules/api/test/.mocharc.js - Coverage: NYC (Istanbul)
- Test location:
modules/api/test/
equa-server/package.json scripts; modules/api/test/ directory structure
equabot-gateway Testing
Unit Tests (Vitest)
- Framework: Vitest
- Config:
vitest.config.ts - Test files: Colocated
*.test.tsnext to source files - Workers: 4-16 locally, 2-3 in CI
E2E and Live Tests
Coverage Requirements
equabot-gateway is the only repo with enforced coverage thresholds:equabot-gateway/vitest.config.ts coverage configuration
equa-patternlib Testing
- Framework: Vitest with Testing Library
- Config:
vitest.config.js - Environment: jsdom (for React component testing)
- Test files: Colocated
*.test.tsxnext to components
equa-patternlib-nextjs/package.json scripts
command-center-so Testing
- Framework: tsx built-in test runner (Node.js
--test) - Test location:
test/directory - Test files:
*.test.ts
command-center-so/package.json scripts
Writing a New Test
Naming Convention
Minimal Test Examples
Vitest (equabot-gateway, equa-patternlib):E2E Setup
Before running Playwright E2E tests for the first time, install browsers:Coverage
Only equabot-gateway will fail CI if coverage drops below thresholds. Other repos generate coverage reports but do not enforce minimums.