Skip to content

Conversation

yosrayousfi
Copy link
Contributor

What

Bug.

Why

expect.toContainKeys throws when actual is undefined.

Reproduction steps

expect({}).toEqual({
    expectedObject: expect.toContainKeys(["expectedProperty"]),
});

Actual behavior

An error is thrown.

Screenshot 2020-09-06 at 13 47 02

Expected behavior

Displaying actual/expected diff.

Screenshot 2020-09-06 at 13 47 23

Notes

Housekeeping

  • Unit tests
  • Documentation is up to date
  • No additional lint warnings
  • Typescript definitions are added/updated where relevant

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@SimenB SimenB merged commit 75f97ab into jest-community:main Oct 6, 2021
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 this pull request may close these issues.

2 participants