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

whyNotEqual #153

Open
ccorcos opened this issue Aug 19, 2016 · 1 comment
Open

whyNotEqual #153

ccorcos opened this issue Aug 19, 2016 · 1 comment

Comments

@ccorcos
Copy link

ccorcos commented Aug 19, 2016

I'm getting what appears to be a bogus error:

    Expected { app: { data: {}, ui: { fetchinUser: false, fetchingInstruments: false, fetchingLoans: false, modalOpen: false, modalView: null, selectedTab: 0, sidebarOpen: false, sidebarView: null, snackbarList: [], snackbarNextId: 0 } }, form: { search: { _active: 'query', _asyncValidating: false, _error: undefined, _initialized: false, _submitFailed: false, _submitting: false, query: { _isFieldValue: true, visited: true } } } } to equal { app: { data: {}, ui: { fetchinUser: false, fetchingInstruments: false, fetchingLoans: false, modalOpen: false, modalView: null, selectedTab: 0, sidebarOpen: false, sidebarView: null, snackbarList: [], snackbarNextId: 0 } }, form: { search: { _active: 'query', _asyncValidating: false, _initialized: false, _submitFailed: false, _submitting: false, query: { _isFieldValue: true, visited: true } } } }

It would be great is failed assertions would use whyNotEqual to report the issue:

https://www.npmjs.com/package/is-equal#want-to-know-why-two-values-are-not-equal

@stevenleeg
Copy link

I recently ran into a similar issue and was able to debug it by importing is-equal/why manually and running it through. Turns out the prototype of the two objects I was comparing where different, causing is-equal to return false and create an assertion error. I'm rolling in here a bit late with this, but you might want to try that in the future if you run into issues like these.

That being said, I also think it'd be great to see error messages use whyNotEqual rather than spitting out the value of both objects in their entirety.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants