jasmine-contains
v1.0.1
Published
Jasmine matchers to check the contents of an array
Downloads
1
Readme
jasmine-contains
Jasmine matchers to check the contents of an array
install
npm install --save-dev jasmine-contains
require("jasmine-contains")
or
<script src="\path\to\jasmine-contains\src\jasmine-contains.js"></script>
Matchers
toContainOnly(array)
Matches if expected array contains all and only the given array objects in any order.
Example
expect([1, "2", { "3": 4 }, 5]).toContainOnly([jasmine.any(Number), jasmine.objectContaining({ "3": 4 }), 1, "2"]);
toContainAll(array)
Matches if expected array contains all the given array objects in any order.
Example
expect([5, 4, 3, 2, 1]).toContainAll([1, 2, 3]);