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

expect.toInclude with expect.subset() does not generate helpful error texts #284

Open
dhardtke opened this issue May 17, 2023 · 0 comments · May be fixed by #285
Open

expect.toInclude with expect.subset() does not generate helpful error texts #284

dhardtke opened this issue May 17, 2023 · 0 comments · May be fixed by #285

Comments

@dhardtke
Copy link
Contributor

(Follow-up to #283 but an issue that can be tackled separately)

Given:

{ _id: 42, foo: 'bar' },
  { _id: 43, foo: 'baz' },
  { _id: 44, lorem: 'ipsum' }
];
expect(items).toInclude([
  expect.subset({ x: 'y' }),
])

If toInclude fails the generated error message is not that helpful:

Uncaught The value [3 entries] does not include [expect.?], but it was expected to.
    at expect().toInclude

It would be great if we could see or opt-in to see the full object or maybe parts of the object that do not include what was expected?

dhardtke added a commit to dhardtke/earl that referenced this issue Jun 9, 2023
@dhardtke dhardtke linked a pull request Jun 9, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant