Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
/ jasmine-contains Public archive

Jasmine matchers to check the contents of an array

License

Notifications You must be signed in to change notification settings

UziTech/jasmine-contains

Repository files navigation

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

About

Jasmine matchers to check the contents of an array

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published