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

New Matcher: .toContainKeys([keys]) #12

Closed
mattphillips opened this issue Oct 23, 2017 · 1 comment
Closed

New Matcher: .toContainKeys([keys]) #12

mattphillips opened this issue Oct 23, 2017 · 1 comment

Comments

@mattphillips
Copy link
Member

Feature Request

.toContainKeys([keys])

Use .toContainKeys when checking if an object has all of the provided keys.

test('passes when object contains all keys', () => {
  const o = { a: 'foo', b: 'bar', c: 'baz' };
  expect(o).toContainKeys(['a', 'b']);
  expect(o).toContainKeys(['b', 'c']);
  expect(o).not.toContainKeys(['d']);
});
@danielr18
Copy link
Contributor

Working on this one

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

No branches or pull requests

2 participants