Regression: Error when matching message body
See original GitHub issueWhat is the expected behavior? To not crash on message body matching if body doesn’t match.
What is the actual behavior? Crashing on message body matching if message body has same count of keys, but different keys.
Possible solution
Go back to using deep-equal
npm package. There was a PR here that introduced custom deepEqual logic that is not good enough.
If two objects have the same count of keys but not the same keys, it tries to extract the keys on undefined
and crashes, making debugging hard to impossible.
How to reproduce the issue
Runkit: Link
Having problem producing a test case? Try and ask the community for help. If the test case cannot be reproduced, the Nock community might not be able to help you.
Does the bug have a test case?
Versions
Software | Version(s) |
---|---|
Nock | 11.3.2 |
Node | 10.15.3 |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:6 (3 by maintainers)
On one hand I agree it’s better to pull in a library rather than solve problems over and over again. On the other side, a lot of what makes deep-equal complicated seems to be its focus on performance, which is not a big consideration in nock.
This particular bug was very shallow, though I’d say we should consider reverting to deep-equal if we find more subtle edge-case bugs.
/cc @mastermatt, I’d be curious your thoughts.
🎉 This issue has been resolved in version 11.3.4 🎉
The release is available on:
Your semantic-release bot 📦🚀