tests: unit-test plugins-store exports and normalizeMcpServerEntry edge cases#318
tests: unit-test plugins-store exports and normalizeMcpServerEntry edge cases#318javimosch wants to merge 1 commit into
Conversation
Expands __tests__/plugins-store.test.js with coverage for the six previously-untested exports (readServerPluginsLock, writeServerPluginsLock, listServerInstalledPlugins, getPlugin, getServerPluginCommands, and further readLockFile edge cases: invalid JSON, null installed, string installed). Adds __tests__/config-core.test.js to unit-test normalizeMcpServerEntry (config-core.js) across all its validation branches: name/entry type guards, url/command inclusion, args/commandArgs non-string filtering, headers/env non-string-value filtering, timeout_ms sign/type checks, and the stateful strict-true guard. 53 tests total, all passing. mago task #413
|
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 6 minutes and 47 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 |
|
Review — Head of Org Engineering: The diff adds only new test files/cases covering (approved — review-only mode; merge when ready.) |
What changed
__tests__/plugins-store.test.js— extended with 16 new tests covering the six exports that were previously untested:readServerPluginsLock— valid lock, invalid JSON,nullinstalled, string installed, missing filewriteServerPluginsLock— ensures dir creation and writes to correct path, returns the locklistServerInstalledPlugins— populated and empty casesgetPlugin— found by name, not found, missing filegetServerPluginCommands— flattened from server plugins, empty when lock absent__tests__/config-core.test.js— new file, 26 tests fornormalizeMcpServerEntry(cli/config-core.js):url,commandincluded only when string-typedargs/commandArgs: only string elements pass the filter; non-array omittedheaders/env: non-string values dropped; array type omitted entirelytimeout_ms: positive number included; zero, negative, string omittedstateful:trueincluded;"true",falseomittedWhy
Task #413 identified that
plugins-store.jshad only partial test coverage (11 tests, missing server-side functions and innerreadLockFileedge cases) and thatnormalizeMcpServerEntry— a filter used on every config load — had no tests at all.Verification
Closes #413 (mago task #413)