mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-07 12:40:49 +00:00
7436b80cda
ci(linter): add renovate/no-redundant-mock-reset rule Vitest sets mockReset: true globally in vitest.config.mts, which resets all mocks before each test. This makes vi.resetAllMocks() / vi.clearAllMocks() and per-mock .mockReset() / .mockClear() calls inside beforeEach/afterEach hooks redundant. Add a custom oxlint rule (enabled for **/*.spec.ts and test/**) flagging such calls, and remove the 40 redundant calls it found. restoreAllMocks/mockRestore are not flagged because restoreMocks is not enabled globally. Two sites keep an inline disable with a reason: nested beforeEach hooks in filter-checks.spec.ts and onboarding/pr/index.spec.ts intentionally call mockReset() to discard once-values queued by an outer beforeEach. Requested by maintainer review feedback (review comment 3052324877). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>