KnisterPeter / expect-partial-array

This is a custom jest matcher for partial array matching

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

expect-partial-array

This jest matcher could be used for example to expect arguments of a function or cli to be given and in correct order.

Installation

$ npm install --save-dev expect-partial-array
# or
$ yarn add -D expect-partial-array

Usage

import "expect-partial-array";

expect(["some", "value", 5]).toMatchPartialArray(["some", 5]);

expect({ key: ["k", "e", "y"] }).toEqual({
  key: expect.toMatchPartialArray(["k", "y"]),
});

About

This is a custom jest matcher for partial array matching


Languages

Language:JavaScript 100.0%