-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[Bug]: toHaveBeenCalledWith matcher matches with any URL object #15032
Labels
Comments
We can see the same behavior when trying to compare it("toEqual not working with URL object", () => {
expect(new URL("http://demo")).toEqual(new URL("http://demo2"));
}); according to the documentation Object.is(new URL("http://demo"), new URL("http://demo2"));
> false |
Also based on this line, URL object would be compared based on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
29.7.0
Steps to reproduce
Please run the test below
Expected behavior
I either expect the last 2 assertions to fail or since the object references are different, I expect all assertions to fail.
Actual behavior
But all assertions pass.
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: