.toExcludeKeys not working as expected
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 115
- PR merge metrics
- No merged PRs in 30d
Description
Hey,
thanks for this great library.
I just came across .toExcludeKeys. And for me it feels that something is wrong here. The docs say:
does not contain any of the provided keys
Which sounds to me, if there is at least one key in the provided keys which is contained in the given object, it should fail.
But then on the other side there is even a test like this
it('does not throw when even one key does not exist', () => {
expect(() => {
expect({ a: 1, c: 3 }).toExcludeKeys([ 'a', 'b', 'c' ])
}).toNotThrow()
})
That looks more like, there needs to be at least on key in keys which is not in object and then it's fine.
Thanks.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with modules/tests/toExcludeKeys-test.js, especially the linked test, and compare its behavior with the documented description of .toExcludeKeys. Determine the intended semantics for a mix of present and absent keys, then align the relevant behavior, documentation, and tests so the expected result is unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100