🎯 Changes#
Closes #262.
This PR replaces the following deprecated Vitest spy assertion aliases with their canonical equivalents:
toBeCalled → toHaveBeenCalled
toBeCalledTimes → toHaveBeenCalledTimes
toBeCalledWith → toHaveBeenCalledWith
These are assertion-only replacements and do not change the existing test behavior.
Affected test files#
packages/pacer/tests/async-debouncer.test.ts
packages/pacer/tests/debouncer.test.ts
packages/pacer/tests/throttler.test.ts
packages/pacer-lite/tests/lite-debouncer.test.ts
packages/pacer-lite/tests/lite-throttler.test.ts
Verification#
packages/pacer: 555 tests passed
packages/pacer-lite: 223 tests passed
- Confirmed that no usages of
toBeCalled, toBeCalledTimes, or toBeCalledWith remain in the repository
✅ Checklist#
🚀 Release Impact#
Summary by CodeRabbit#
- Tests
- Updated test assertions to use current Vitest matcher names.
- Test coverage, scenarios, expected results, and runtime behavior remain unchanged.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
92eaf5ea-cddf-4e60-addf-268c8613658d📥 Commits
Reviewing files that changed from the base of the PR and between 9233835f9ce19ca2fddabb6de789794bf4c15b96 and eda891d508b7a05eb8782627dd0ba5cd480ebbdb.
📒 Files selected for processing (5)
packages/pacer-lite/tests/lite-debouncer.test.tspackages/pacer-lite/tests/lite-throttler.test.tspackages/pacer/tests/async-debouncer.test.tspackages/pacer/tests/debouncer.test.tspackages/pacer/tests/throttler.test.tsIncluded review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Walkthrough#
The change replaces deprecated Vitest spy assertion aliases with canonical
toHaveBeenCalled*equivalents across five debouncer and throttler test files. Assertion counts, arguments, timing, and test scenarios remain unchanged.Changes#
Vitest matcher migration
packages/pacer-lite/tests/lite-debouncer.test.tsLiteDebouncerandliteDebouncetests to use canonical call, count, and argument matchers.packages/pacer-lite/tests/lite-throttler.test.tsLiteThrottlerandliteThrottletests to use canonical call, count, and argument matchers.packages/pacer/tests/debouncer.test.tsDebounceranddebouncetests to use canonical spy matchers.packages/pacer/tests/async-debouncer.test.tspackages/pacer/tests/throttler.test.tsThrottlerandthrottletests to use canonical spy matchers.Priority: ⬇️ Low
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Refactor · Severity of issue fixed: Low
Suggested reviewers:
kevinvandyMerge Risk: ⚪ Minimal · up to
eda89This test-only migration preserves existing behavior and presents no material merge risk.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
ciscope is slightly broad because the changes are limited to test files, but the title remains spe…#262requires replacing deprecated VitesttoBe*spy aliases withtoHaveBeen*equivalents while preserving assertions and test behavior. The PR updates the five listed test files, including n…#262and…✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share