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

jest-plugin-must-assert

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-plugin-must-assert

Jest plugin for async tests

  • 0.0.1
  • npm
  • Socket score

Version published
Weekly downloads
5.6K
decreased by-52.09%
Maintainers
1
Weekly downloads
 
Created
Source

jest-plugin-must-assert

A plugin extending the default Jest behavior to fail any tests which do not perform a runtime assertion.

Install

npm i -D jest-plugin-must-assert

For default behavior, add the plugin to your setup files.

...
setupFilesAfterEnv: ['jest-plugin-must-assert'],
...

You may also extend the default behavior with the following, manual configuration.

// <rootDir>/must-assert-setup.js
const mustAssert = require('jest-plugin-must-assert/manual');

mustAssert({
  message: 'Please see https://jestjs.io/docs/en/asynchronous for details on testing async code.'
});

Then in your config file:

...
setupFilesAfterEnv: [
  '<rootDir>/must-assert-setup'
],
...

Problem

Static analysis is not enough to catch mistakes in asynchronous tests. For this, we require a runtime check that some assertion was ran during the test.

Keywords

FAQs

Package last updated on 11 Apr 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