Loading…
Loading…
Main has `calculateDiscount.ts` with no tests. Leadership wants coverage pushed to 95%. A colleague sent a PR — a new file with 5 tests. All green, coverage jumped. But you know: coverage ≠ quality. Walk the diff and find the tests that don't actually check anything.
95% coverage doesn't mean "good tests". A test can just call the function and check nothing — coverage goes up, but when a regression happens the test is still green. Bad-test markers: 1. `toBeDefined()`, `toBeTruthy()` on the result — only catches null/undefined. 2. `not.toBe(something)`, `not.toEqual` — pass for almost any value. 3. `not.toThrow()` — only "no exception", not the result. 4. `toHaveBeenCalled()` without arguments — doesn't check the call data. 5. Tautologies like `expect(x).toBe(x)`. 6. `it('should work')`, `it('works')` — no behavior description. Walk the tests and find all these patterns.