test: cover non-object preference payload edge cases - #18
Conversation
Add regression tests for normalizeSearchPreferences when given null/string/number/array inputs and for unknown keys being ignored. Fixes #11
TuYv
left a comment
There was a problem hiding this comment.
Thanks for adding regression coverage and for documenting the uncovered case on #11 first. The non-object payload test is on target and the full suite passes locally.
Please keep this PR to the one focused behavior requested by #11. It currently adds a second, independently named behavior for unknown-key stripping. Please remove that second test from this PR, or move it to a separate follow-up issue/PR, so this change remains limited to non-object preference payloads.
|
Addressed review: removed the second unknown-key stripping test. This PR is only the non-object payload coverage for #11. |
|
Ready for re-review: dropped the second unknown-key test; PR is only non-object preference payloads for #11. |
|
Withdrawing. |
Summary
Two focused regression tests for
normalizeSearchPreferencesedge cases that were not covered.Problem
Fixes #11 — requested one untested preference edge case.
Approach
null, string, number, boolean, array) → full defaults, no throwHow I tested
node --test tests/*.test.js— 130 passChecklist
node:test+node:assert/strict