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

deep equal comparison fails when objects contain function #9

Closed
Goszu opened this issue Apr 19, 2016 · 3 comments
Closed

deep equal comparison fails when objects contain function #9

Goszu opened this issue Apr 19, 2016 · 3 comments

Comments

@Goszu
Copy link

Goszu commented Apr 19, 2016

I'm trying to write unit tests for my redux-saga functionality. I found out that there is an issue when trying to compare 2 identical objects containing a function. Basically it never equals:

const obj1 = {
  test: function () {},
  prop: 'prop',
};
const obj2 = {
  test: function () {},
  prop: 'prop',
};

I've seen example created using Tape framework where that comparison worked.

@tunnckoCore
Copy link

tunnckoCore commented Apr 19, 2016

Maybe https://github.com/tunnckoCore/function-equal can help internally :)

@hildjj
Copy link

hildjj commented Jun 7, 2016

This should be pretty easy on top of #12, if someone who understands componentjs enough to get the new dependency to work were to look at it.

@keithamus keithamus mentioned this issue Jun 7, 2016
@keithamus
Copy link
Member

Hey @Goszu thanks for the issue. We've released a new version of deep-eql, which does not fix this issue directly, but it allows overriding of comparators which should enable you to achieve the behaviours you're after. Thanks for filing this!

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

No branches or pull requests

4 participants