-
-
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
expect.toMatchObject throws TypeError instead of showing diff #6730
Comments
Been running into this issue for a while. It took me a while to realize that this TypeError is only thrown when the objects don't match. Makes a lot more sense now that I'm looking at @shai32's findings. |
A PR fixing this is most welcome! |
* handle objects with no constructor in hasOwnProperty Closes #6730 * update changelog
To include fix for: jestjs/jest#6730
* update jest To include fix for: jestjs/jest#6730 * Remove noEmitOnError from tsconfig * Remove unneeded mock * Fix test Not sure why, but jest seems to have trouble loading some modules, the filter(Boolean) makes the test pass * Dedupe packages * Accept keyPrefix in config to allow per client storage in multi-client * Pass keyPrefix when creating store * Typescript fixes * Add colon to keyPrefix in store * Remove unused import * Return false instead of undefined when response is not optimistic * Enforce unique keyPrefixes among clients Unit tests refactoring to account for module state (keyPrefixesInUse) * Improve typings for auth options * Make invalid auth type error non retryable * Add test coverage for AWS_IAM auth mode * Kepp client instances around to prevent garbage collection * Use default prefixKey from redux-persist
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
expect.toMatchObject
throws a TypeError when an object A is expected to match an object B, where A has been created withObject.create(null)
and B has properties that aren't in A.To Reproduce
Output:
Expected behavior
The test should fail and show the diff between the objects.
Link to repl or repo (highly encouraged)
https://repl.it/repls/SizzlingWoodenAcrobat
The text was updated successfully, but these errors were encountered: