jasmine-should-include-fragment

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

shouldIncludeFragment

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


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