Verify correctness early, often, and automatically
All core business logic functions and methods must have comprehensive unit tests using Jest, Mocha, or similar testing frameworks with at least 80% code coverage for critical paths.
Integration tests must verify that components, services, and external systems work correctly together using test databases, mock services, or test containers to simulate real environments.
Unit tests must use mocking libraries like Jest mocks, Sinon, or custom mocks to isolate the unit under test from external dependencies and enable focused testing of specific functionality.