Repository navigation
test(coding-agent): add unit tests for settings-list-values parsers - #360
Shellghostt wants to merge 2 commits into
Conversation
|
OMK Community Thanks for opening this pull request. Mention Automated response. No code changes or merges are performed. |
dmae97
left a comment
There was a problem hiding this comment.
Reviewed the single test-file diff at 30604045 against main (4896be96). One coverage issue needs correction: the empty/whitespace provider-ID cases currently exercise non-array rejection instead of invalid array entries. Details are inline.
This is a source review; I have not independently run Vitest or Biome. CI run 42437057490 is action_required, with zero jobs and zero check runs for this head. Successful repository CI is still needed before merge.
| expect(parseSubscriptionUsageProviders([" openai"])).toEqual([" openai"]); | ||
| }); | ||
|
|
||
| it.each([[""], [" "]])("rejects empty or whitespace-only entries %j", (value) => { |
There was a problem hiding this comment.
it.each spreads each array row into callback arguments, so these rows pass "" and " " to value, not [""] and [" "]. parseSubscriptionUsageProviders therefore throws at !Array.isArray(value), and the assertions would still pass if the value.some(...) entry validation were removed. That leaves the empty/whitespace cases requested by #359 untested. Please pass arrays to the parser, for example use it.each(["", " "]) and call parseSubscriptionUsageProviders([value]), or wrap each array in another row. Then rerun the targeted test; removing the entry-validation clause temporarily should make these cases fail.
There was a problem hiding this comment.
Fixed in 7c55712 with the exact shape you suggested. Mutation check confirmed: removing the entry-validation clause now fails precisely these two cases. Details in the PR comment above.
There was a problem hiding this comment.
Rechecked 7c557127 against current main (4896be96). Both cases now pass [entry] to parseSubscriptionUsageProviders, so they reach the array-entry validation rather than the non-array guard. This source-level finding is addressed, and the full PR diff still contains only the test file.
I have not independently rerun Vitest, Biome, or the mutation check reported above. CI run 42439423299 for this head is still action_required, with zero jobs and zero check runs. Successful repository validation is still needed before merge; this follow-up is not merge approval.
|
Fixed in 7c55712 — thank you, that was a real coverage hole. The cases now use Verified as you suggested:
CI for this head still shows as requiring approval on your side — please let me know if there's anything else you'd like adjusted. |
|
Follow-up on the validation gap: since the upstream CI run for this head is
That doesn't replace the upstream run — it still needs an approval click on your side — but the branch itself now has a green full CI pass at the exact head SHA. Happy to adjust anything else you'd like changed. |
Closes #359
Summary
Adds direct unit tests for
parseDefaultActiveSkillsandparseSubscriptionUsageProvidersinpackages/coding-agent/src/core/settings-list-values.ts, which previously had no dedicated test file. Tests only; no source changes.Coverage
parseDefaultActiveSkills:undefined/empty array, valid kebab-case names kept in order, duplicates dropped first-seen, invalid names rejected (Foo,foo_bar,-foo,foo-,foo--bar, empty), 64-character name accepted / 65 rejected, 64 entries accepted / 65 rejected, non-array andnullrejected — with the exact error messages from the implementation.parseSubscriptionUsageProviders:undefinedpassthrough, empty array, IDs kept in order, padded IDs kept as-is, empty/whitespace-only and non-array inputs rejected, and the returned array is a copy of the input.Tests
node ../../node_modules/vitest/dist/cli.js --run test/settings-list-values.test.ts(frompackages/coding-agent) — 19 passed.biome check test/settings-list-values.test.ts— clean after formatting.