Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-matcher-one-of

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-matcher-one-of

A Jest matcher to test if a value is one of many (like enums)

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-14.26%
Maintainers
1
Weekly downloads
 
Created
Source

jest-matcher-one-of

Build Status codecov Test Coverage CodeFactor Codacy Badge Maintainability Known Vulnerabilities Greenkeeper badge

A Jest matcher (toBeOneOf) to test if a value is one of many (like enums).

Installation

  1. Add the package

    yarn add jest-matcher-one-of --dev
    npm install jest-matcher-one-of --save-dev
    
  2. Require the package at the root of your test files

    require('jest-matcher-one-of');
    import 'jest-matcher-one-of'; // Using ES6 w/ Babel or TypeScript
    

Usage

expect(1).toBeOneOf([1, 2]);
expect(1).not.toBeOneOf([2, 3, 4]);
expect(1).toBeOneOf(1); // 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

Keywords

FAQs

Package last updated on 13 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc