Introduce minimal linting for tests - #109
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pull request adds Vitest ESLint rules for TypeScript tests, extends JavaScript restrictions to test files, strengthens lifecycle and mock assertions, and corrects test descriptions across integration and unit test suites. ChangesVitest test quality
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/integration/deviceEvents.spec.ts`:
- Around line 124-125: Update the test around the existing getConnectedDevices()
length assertion to also verify that the remaining device’s getDeviceId matches
the expected non-target device identity after NEW_DEVICE_ID disconnects, while
preserving the existing length check.
In `@tests/unit/settings/settingsManager.spec.ts`:
- Around line 149-150: Replace the invalid toThrow assertions on stopWatching()
with a value-based promise assertion, such as resolves.toBeUndefined(), matching
its Promise<void> contract; retain both repeated stopWatching() calls to verify
repeated shutdown remains successful.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9c150871-a927-4a73-a706-f4e20cfa6164
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (17)
eslint.config.tspackage.jsontests/integration/deviceEvents.spec.tstests/unit/automation/scriptRuntime.spec.tstests/unit/controller/getDevicesController.spec.tstests/unit/device/deviceManager.spec.tstests/unit/device/knownDeviceRegistry.spec.tstests/unit/device/protocol/airotic/airoticDevice.spec.tstests/unit/device/protocol/buttplugIo/buttplugIoDevice.spec.tstests/unit/device/protocol/estim2b/estim2bDevice.spec.tstests/unit/device/protocol/slvCtrlPlus/genericSlvCtrlPlusDevice.spec.tstests/unit/device/protocol/slvCtrlPlus/slvCtrlProtocolLegacy.spec.tstests/unit/device/protocol/slvCtrlPlus/slvCtrlProtocolV1.spec.tstests/unit/device/protocol/virtual/display/displayVirtualDevice.spec.tstests/unit/device/transport/bleObserver.spec.tstests/unit/device/transport/serialPortObserver.spec.tstests/unit/settings/settingsManager.spec.ts
- Assert remaining device identity, not just count, after device removal - Fix invalid resolves.not.toThrow() pattern for Promise<void> assertions
Summary by CodeRabbit
Tests
Chores