Testing
Jest Mock Reset Strategy Explainer
clearMocks vs resetMocks vs restoreMocks - what each actually does. They're cumulative, not alternatives, and picking the wrong one is a common source of state leaking between tests.
resetMocks: trueDoes everything clearMocks does, AND removes any mocked implementation - mockFn becomes a plain jest.fn() that returns undefined.
Use when: You want every test to explicitly set up its own mock behavior, so one test's mockReturnValue can't silently leak into the next.
This is one question. ArchSetu answers it for a whole repository.
Call graph, dead code, blast radius and a health score, in about a minute.
Related tools
All Testing tools →Load Testing Capacity CalculatorConcurrent users and response time to required req/sec.Test Flakiness Rate CalculatorTotal runs and failures to a flakiness score - peaks near a 50/50 split, not a consistent failure.Test Coverage Gap CalculatorTotal lines, covered lines, and a target % to exactly how many more lines need coverage.Test Selector Robustness CheckerPaste a CSS or test selector - flagged robust, moderate, or fragile based on what breaks in CI.Test Pyramid Ratio CalculatorUnit, integration, and e2e counts - your test shape, and whether it inverted into the ice cream cone.Flaky Test CI Cost CalculatorFlake rate, retry count, and CI cost per minute - the real monthly cost flaky tests are burning.
Was this tool helpful?