Get unlimited public & private packages + team-based management with npm Teams.Learn more »

jasmine-contains

1.0.0 • Public • Published

Build Status Windows Build 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]);

Install

npm i jasmine-contains

DownloadsWeekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

13.3 kB

Total Files

11

Last publish

Collaborators

  • avatar