Always verify that tests cover all relevant scenarios, edge cases, and conditions rather than just the happy path. When reviewing or writing tests, actively look for missing test cases and suggest additional coverage.
Always verify that tests cover all relevant scenarios, edge cases, and conditions rather than just the happy path. When reviewing or writing tests, actively look for missing test cases and suggest additional coverage.
Key areas to examine:
Example from the discussions:
// Instead of just testing the basic case
it('window opened with innerWidth option has the same innerWidth', async () => {
// ... basic test
});
// Also test against related functionality
it('should also test against win.getContentSize()', async () => {
// ... additional coverage
});
// And test edge cases
it('emits the resize event for single-pixel size changes', async () => {
const [width, height] = w.getSize();
const size = [width + 1, height - 1]; // Test both + and - changes
});
When you encounter a test that seems to work “incidentally” or only covers one scenario, ask: “What other conditions should this handle?” and “Are we missing any important edge cases?”
Enter the URL of a public GitHub repository