tests: unit-test cli/plugins-doctor.js (35 cases — checkBinary, doctorPlugin, doctorAllPlugins)#320
tests: unit-test cli/plugins-doctor.js (35 cases — checkBinary, doctorPlugin, doctorAllPlugins)#320javimosch wants to merge 2 commits into
Conversation
22 tests covering: - setMcpServer upsert: insert-new, update-existing, string→url, object merge, headers/env, null-value bare entry, throws code-85 on empty name, return value, write-to-cache - dedup via normalizeMcpServers: deduplicate same-name (last-wins), sorted alpha output, null/invalid entries stripped, numeric name dropped - removeMcpServer persistence: removes named entry returns true, cache file updated, single-of-many removal - remove-missing no-op: returns false for absent name, for missing field, for missing cache, for empty array Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y, doctorPlugin, and doctorAllPlugins Tests cover: binary check ok/fail/ENOENT/non-ENOENT paths, default args, null/undefined check entries skipped by guard, missing type/name in check skipped, unknown adapter policy check, shell unsafe=true policy, non_interactive=false policy, adapter_counts, (missing) adapter label, checks.every undefined guard (every check carries explicit ok boolean), empty-checks ok:true invariant, doctorAllPlugins empty/all-pass/one-fail/ missing-name-field edge cases, reports.every propagation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
More reviews will be available in 51 minutes and 10 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?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 credits. 🚦 How do rate 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 see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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. Comment |
What changed
Added
__tests__/plugins-doctor.test.jswith 35 unit tests covering all three exports fromcli/plugins-doctor.js:checkBinary,doctorPlugin, anddoctorAllPlugins.All direct dependencies are mocked (
child_process,plugins-store,plugins-registry,plugin-install-guidance,adapter-schema,plugins-manifest), keeping tests fast and isolated.Coverage highlights
checkBinary(8 tests)--versionargsdoctorPlugin(19 tests)resource_not_foundfor unknown pluginchecks/commandsproperties → ok:true, counts=0checksskipped byif (check && ...)guardtypefield skipped; binary check missingnameskipped; non-binary type skippedchecks.everyundefined guard: asserts every check object carries an explicitbooleanokfield — no silent undefined gapschecks.everyreturns true (ok:true invariant)unsafe:true→ policy error; shell withunsafe:true→ no error,unsafe_commandsincremented;non_interactive:false→ policy erroradapter_countstallied correctly;(missing)label for undefined adapterinstall_guidanceforwarded fromgetPluginInstallGuidancedoctorAllPlugins(8 tests){ok:true, total_plugins:0, failing_plugins:[]}namefield →doctorPlugin(undefined)propagates throwreports.everyok:false propagation; plugins array length matches installed countVerification
Closes #420 (mago task #420)