test(solid-query-devtools/devtoolsPanel): assert the default 'onClose' is a no-op instead of 'expect.any(Function)'#11030
Conversation
…' is a no-op instead of 'expect.any(Function)'
|
View your CI Pipeline Execution ↗ for commit b58fbd8
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change refines a single unit test for ChangesTest refinement for default onClose behavior
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
size-limit report 📦
|
🎯 Changes
The panel's default
onClosetest assertedexpect.any(Function), which passes for any function and cannot catch a regression in theprops.onClose ?? (() => {})defaulting logic.The test now captures the forwarded argument and verifies it is a callable no-op (invoking it does not throw and returns
undefined) instead of any function.The "forward" test already asserts the exact callback (
toHaveBeenCalledWith(onClose)), so it is left as-is.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit