jest-matcher-one-of
A Jest matcher (toBeOneOf
) to test if a value is one of many (like enums).
Installation
-
Add the package
yarn add jest-matcher-one-of --devnpm install jest-matcher-one-of --save-dev -
Require the package at the root of your test files
;; // Using ES6 w/ Babel or TypeScript
Usage
;not;; // Also forgiving for non-array values
Contributing
Get the source code and run the tests.
$ git clone git@github.com:d4nyll/jest-matcher-one-of.git$ yarn # or npm install $ yarn test # or npm test