1.0.1 • Published 2 years ago

jasmine-contains v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

Actions Status

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]);