🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

assertion-error

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assertion-error

Error constructor for test and validation frameworks that implements standardized AssertionError specification.

2.0.1
latest
Source
npm
Version published
Weekly downloads
25M
16.33%
Maintainers
2
Weekly downloads
 
Created

What is assertion-error?

The assertion-error package is used to create error objects that are specifically meant for testing assertions. It is commonly used in conjunction with assertion libraries to provide a more descriptive error message when an assertion fails. The error object created by assertion-error includes a message and can also include properties that describe the assertion that failed.

What are assertion-error's main functionalities?

Creating an AssertionError instance

This feature allows you to create an instance of an AssertionError with a custom message. This is useful when you want to throw a specific error in your tests when an assertion fails.

{"const AssertionError = require('assertion-error');
const error = new AssertionError('expected value to be true');
throw error;"}

Other packages similar to assertion-error

Keywords

test

FAQs

Package last updated on 18 Oct 2023

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