Conversation
lbesecker195
approved these changes
Sep 13, 2026
lbesecker195
left a comment
There was a problem hiding this comment.
Confirmed the bug on main: isSubsetOf compares elem === superset[idx] for ordered subsets, so reading past the end of the target yields undefined and expect([1]).to.include.ordered.members([1, undefined]), expect([]).to.include.ordered.members([undefined]) and assert.includeOrderedMembers([1], [1, undefined]) all pass. On this branch they fail with the expected message, while [1, 2, 3] including [1, 2], [1, undefined] including [1, undefined], and [] including [] still pass. The non-include path already checks lengths, so the new guard only affects contains. After npm run build, the node suite is 511 passing. LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ordered member inclusion currently accepts expected sequences that extend past the target with
undefinedvalues. For example,expect([1]).to.include.ordered.members([1, undefined])passes because reading past the target's end producesundefined.Check the sequence lengths before ordered comparison. Regression coverage exercises strict and deep comparisons through
expect,should, andassert, including empty targets, trailingundefinedvalues, valid equal-length matches, and negation.Validation on Node.js v24.16.0 (Windows):
npm run test-node -- --reporter dot: 511 passing.npm run lint: passes with the existing JSDoc warnings.Developed with assistance from OpenAI Codex; reproduction and tests were run locally.