New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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)

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jest-matcher-one-of

Sponsor

Build Status codecov Test Coverage CodeFactor Codacy Badge Maintainability NSP Status Known Vulnerabilities

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 18 Nov 2017

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