-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add support for Error objects in toMatchObject #4339
Conversation
@@ -0,0 +1 @@ | |||
test('snapshots', () => expect({apple: "updated value"}).toMatchSnapshot()); |
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.
This needs Jest's Copyright header, and a trailing newline please.
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.
Actually, I don't understand the purpose of this test. Why is it here?
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.
I think my tests went badly. I was running on Windows and a bunch of stuff was failing. Will fix now that I'm back on the mac.
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.
Aha, I believe these files got added because I interrupted a test run, and it creates/deletes files during tests but when you interrupt it doesn't clean up properly. Mystery solved 👌
Please add type annotations and make sure |
Hi, thanks for the reply. I fixed the files that got added by accident. They got added because i interrupted a test run and then those files remain in the working directory, and I just added + committed all my working directory.
I'll look into adding the type definitions as well. I suppose they are now needed because we are importing the function from another file. That makes sense 👍 |
Thank you! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
#3859 - Add support for
Error
objects intoMatchObject()
I didn't realise the original PR got closed after my suggestion, and then I completely lost track of it. Sorry for that: #3866
Explanation of this fix: #3866 (comment)
I also moved some functions to the
utils.js
file.Test plan
Unit tests were added