Skip to content
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

Merged
merged 4 commits into from
Aug 24, 2017

Conversation

jseminck
Copy link
Contributor

Summary
#3859 - Add support for Error objects in toMatchObject()

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

@@ -0,0 +1 @@
test('snapshots', () => expect({apple: "updated value"}).toMatchSnapshot());
Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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 👌

@cpojer
Copy link
Member

cpojer commented Aug 24, 2017

Please add type annotations and make sure yarn test passes locally.

@jseminck
Copy link
Contributor Author

jseminck commented Aug 24, 2017

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.

yarn test now passes 😄

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 👍

@cpojer cpojer merged commit 441bd0a into jestjs:master Aug 24, 2017
@cpojer
Copy link
Member

cpojer commented Aug 24, 2017

Thank you!

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants