Skip to content

hasProp matcher doesn't allow for object equality #13

@davishyer

Description

@davishyer

Given the following Subject, using the hasProp matcher will return false when providing an equivalent object. This is because the matcher looks for strict equality over object equality.

<Subject>
  <MyComponent prop={{ foo: 'bar' }} />
</Subject>

drill(Subject)
  .find(MyComponent, m.hasProp('prop', { foo: 'bar' })) // => false

{ foo: 'bar' } === { foo: 'bar' } // => false
_.isEqual({ foo: 'bar' }, { foo: 'bar' }) // => true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions