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 - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

8

e2e/failing/__tests__/index.js

@@ -8,2 +8,6 @@ /**

test('synchronous failure', () => {
expect(true).toBe(false);
});
test('missed runtime assertion', () => {

@@ -56,2 +60,6 @@ const unused = () => expect(true).toBe(true);

it('synchronous failure', () => {
expect(true).toBe(false);
});
// https://github.com/facebook/jest/issues/8297

@@ -58,0 +66,0 @@ it('unreturned promise assertions', () => {

2

package.json
{
"name": "jest-plugin-must-assert",
"version": "1.3.0",
"version": "1.4.0",
"description": "Jest plugin for async tests",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,7 +8,7 @@ # `jest-plugin-must-assert`

Asynchronous tests could be challenging to get _right_, particulrary for junior
Asynchronous tests could be challenging to get _right_, particularly for junior
developers or engineers new to async JavaScript. The most common mistake is an async
test which does not fire any assertions, either due to logic or even syntax errors.
Static analysis(linters) gets close to pointing out the issues, but is not enough to catch logic mistakes.
For this, we require a runtime check that _some_ assertion was ran during the test.
Static analysis (linters) gets close to pointing out the issues, but is not enough to catch logic mistakes.
For this, we require a runtime check that _some_ assertion was run during the test.

@@ -98,4 +98,4 @@ [Jest, unfortunately, has no "failWithoutAssertions" configuration options, so this plugin aims to remedy that.](https://github.com/facebook/jest/issues/2209)

There is some performance implications of using this plugin as it does add a bit of
There are some performance implications of using this plugin as it does add a bit of
overhead, but from testing it's a trivial increase. This plugin has been tested
within a project with 1600+ test suites and over 10k individual tests, with only a negligble slow-down.
within a project with 1600+ test suites and over 10k individual tests, with only a negligible slow-down.

@@ -73,4 +73,5 @@ const StackUtils = require('stack-utils');

logger.warn(`${e.message}\n\n${stack.clean(e.stack)}`);
return false;
}
return false;
throw e;
},

@@ -77,0 +78,0 @@ onInvokeTask(delegate, current, target, task, applyThis, applyArgs) {

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