Additional matcher for testing whether an object matches a fragment of attributes

npm install jasmine-should-include-fragment
2 downloads in the last week
13 downloads in the last month


Jasmine matcher designed to allow you to test whether a particular JSON object matches a fragment, only comparing the keys that the fragment has.


expect({foo: "bar", unrelated_field: 42}).toIncludeFragment({foo: "bar"}) //passes
npm loves you