Run the comprehensive test suite for the ExFabrica Agentic Factory monorepo, including unit tests, integration tests, and end-to-end tests for both backend and frontend applications.
Run the complete test suite for the ExFabrica Agentic Factory monorepo, including unit, integration, and E2E tests for both backend and frontend. Use it before commits or deployments to verify all components work correctly.
/plugin marketplace add hubexab/EAF-PluginClaude/plugin install exfabrica-af-plugin@exfabrica-af-marketplaceRun the comprehensive test suite for the ExFabrica Agentic Factory monorepo, including unit tests, integration tests, and end-to-end tests for both backend and frontend applications.
/test-all [target] [--coverage] [--watch] [--verbose]
backend - Run only backend testsfrontend - Run only frontend testse2e - Run only end-to-end testsunit - Run only unit tests (backend + frontend)integration - Run only integration testsUnit Tests
Integration Tests
Test Location: apps/backend/src/**/*.spec.ts
Test Runner: Jest
Configuration: apps/backend/jest.config.js
Unit Tests
Integration Tests
Test Location: apps/frontend/src/**/*.spec.ts
Test Runner: Karma + Jasmine
Configuration: apps/frontend/karma.conf.js
E2E Scenarios
Test Location: apps/frontend/e2e/
Test Runner: Protractor/Cypress (based on configuration)
When you execute this command, Claude will:
Environment Setup
Backend Tests
yarn workspace @bdqt/backend testyarn workspace @bdqt/backend test:integrationFrontend Tests
yarn workspace @bdqt/frontend test --watch=falseE2E Tests (if applicable)
Results Aggregation
/test-all
Executes the complete test suite across all applications.
/test-all backend
Runs only the backend unit and integration tests.
/test-all frontend
Runs only the frontend unit tests using Karma.
/test-all --coverage
Generates code coverage reports for all test suites.
/test-all backend --watch
Runs backend tests in watch mode for active development.
/test-all e2e --verbose
Runs end-to-end tests with detailed logging.
The test suite enforces minimum coverage thresholds:
Tests will fail if coverage drops below these thresholds.
✓ Backend Unit Tests: 245 passed
✓ Backend Integration Tests: 67 passed
✓ Frontend Unit Tests: 189 passed
✓ E2E Tests: 34 passed
Total: 535 tests passed
Coverage: 82.5% (above threshold)
Duration: 3m 24s
All tests passed successfully! ✓
✗ Backend Unit Tests: 243 passed, 2 failed
- UserService.createUser should hash password (apps/backend/src/users/users.service.spec.ts:42)
- AuthGuard should reject expired tokens (apps/backend/src/auth/auth.guard.spec.ts:78)
✓ Backend Integration Tests: 67 passed
✓ Frontend Unit Tests: 189 passed
Total: 499 tests passed, 2 failed
Coverage: 79.2% (below threshold)
Tests failed. Please fix the failing tests before proceeding.
Error: Cannot connect to test database
Solution: Ensure Docker is running and test database is available
docker compose up -d postgres-test
Error: ChromeHeadless not found
Solution: Install Chromium or configure alternative browser
yarn add -D puppeteer
Error: Port 3001 already in use
Solution: Stop any running development servers or use different test ports
Error: JavaScript heap out of memory
Solution: Increase Node.js memory limit
export NODE_OPTIONS="--max-old-space-size=4096"
Error: Element not found within timeout
Solution: Increase wait timeouts or add explicit waits in E2E tests
Tests run in parallel by default using Jest workers:
--maxWorkers=50%--parallel=trueJest caches test results between runs:
# Clear test cache if needed
yarn jest --clearCache
Run only changed tests during development:
yarn test --onlyChanged
This command is designed to work seamlessly with Azure DevOps pipelines:
- task: Script@1
displayName: 'Run Test Suite'
inputs:
script: |
/test-all --coverage
Test results are automatically formatted for Azure DevOps:
Run tests before committing
/test-all
# Commit only if all tests pass
Use watch mode during development
/test-all backend --watch
Check coverage regularly
/test-all --coverage
Fix failing tests immediately
Run E2E tests before major releases
/test-all e2e
/deploy - Deploy after tests pass/analyze-code - Check code quality and test coverage/db-operations seed - Seed test database with fixturesdescribe('UserService', () => {
it('should create a new user with hashed password', async () => {
const userData = { email: 'test@example.com', password: 'password123' };
const user = await userService.create(userData);
expect(user.password).not.toBe('password123');
expect(await bcrypt.compare('password123', user.password)).toBe(true);
});
});
describe('LoginComponent', () => {
it('should disable submit button when form is invalid', () => {
component.loginForm.controls['email'].setValue('');
fixture.detectChanges();
const submitButton = fixture.nativeElement.querySelector('button[type="submit"]');
expect(submitButton.disabled).toBe(true);
});
});
Note: All tests use the Yarn workspace structure. Direct Jest/Karma commands should be run through Yarn workspaces to respect the monorepo configuration.