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

@hitorisensei/jest-assert-with

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hitorisensei/jest-assert-with

Extends jest with toAssertWith matcher that allows you to perform an assert check with a provided assert function.

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jest-assert-type

Adds toAssertWith method to jest that allows assert check with a provided function.

Test will fail if provided function throws.

Message is created by casing thrown exception to String.

Setup

TypeScript

import the package in you test suite

import '@hitorisensei/jest-assert-with';

this ensures that jest namespace is properly extended and toAssertWith is visible to TypeScript

JavaScript

You can use one of two ways

add setupFilesAfterEnv to jest config
{
  "setupFilesAfterEnv": [
    "@hitorisensei/jest-assert-with/index.ts"
  ]
}
or import in you test suite
import '@hitorisensei/jest-assert-with';

Why

Made for use with typescript-is createAssertType and createAssertEquals functions.

This allows testing values against TypeScript types.

FAQs

Package last updated on 11 Jul 2022

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