-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kbn-expect - add .eql support for sets #200034
Conversation
// format sets like arrays | ||
if (value instanceof Set) { | ||
value = Array.from(value) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format doesn't know how to handle sets properly, so it applies the code for generic objects, which prints a failure message like this:
expected {} to sort of equal {}
The quickest way to get a proper output was treating the sets as arrays for formatting purposes, which prints out failure messages like this:
expected [ 'a', 'b', 'c' ] to sort of equal [ 'x', 'y', 'z' ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for adding tests.
💚 Build Succeeded
Metrics [docs]
History
cc @pheyos |
## Summary This PR adds support for asserting test equality with kbn-expect. It also introduces some unit tests to kbn-expect in order to verify the changes are working.
## Summary This PR adds support for asserting test equality with kbn-expect. It also introduces some unit tests to kbn-expect in order to verify the changes are working.
## Summary This PR adds support for asserting test equality with kbn-expect. It also introduces some unit tests to kbn-expect in order to verify the changes are working.
Summary
This PR adds support for asserting test equality with kbn-expect. It also introduces some unit tests to kbn-expect in order to verify the changes are working.