Skip to content

Instantly share code, notes, and snippets.

@JimmyLv
Created January 6, 2021 07:16
Show Gist options
  • Select an option

  • Save JimmyLv/b824bc348c9d38299dbdfc8d26639bc6 to your computer and use it in GitHub Desktop.

Select an option

Save JimmyLv/b824bc348c9d38299dbdfc8d26639bc6 to your computer and use it in GitHub Desktop.
Created with Copy to Gist
const user = {
id: 1,
name: 'Hugo',
friends: [3, 5, 22]
};
test('user 3 should be a friend of user', () => {
expect(user).toEqual(
expect.objectContaining({
friends: expect.arrayContaining([3])
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment