This document describes MHA testing policy, local test execution, coverage requirements, and CI validation.
- Major functionality changes must include or update automated Jest tests in the same pull request.
- When behavior changes, contributors are expected to add or update tests that validate the new behavior.
- Automated tests must include assertion checks (Jest
expect(...)) for behavior verification. - Pull requests are validated by CI running
npm test. - Global minimum coverage thresholds are enforced in
jest.config.ts:- branches: 35
- functions: 40
- lines: 40
- statements: 40
- Install dependencies:
npm install - Start local development server when validating UI behavior:
npm run dev-server - Run lint and fix issues:
npm run lint - Run tests:
npm test
- Local unit test runner page: https://localhost:44336/Pages/test/
- Local coverage report page: https://localhost:44336/Pages/coverage/lcov-report/
- Hosted unit test report: https://mha.azurewebsites.net/Pages/test
- Hosted code coverage report: https://mha.azurewebsites.net/Pages/coverage/lcov-report
- Workflow:
.github/workflows/jest.yml - Triggered on pull requests, merge groups, workflow dispatch, and pushes to
main. - CI executes:
npm cinpm test