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

assertextras

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

assertextras

extra assertion types for nodeunit

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

assertExtras

Used to extend the assertion types available in nodeunit. To use, simply call:

var assert = require("nodeunit/lib/assert");
require("assertextras")(assert);

At the top of you test suite, and it will monkey-patch the assertions in nodeunit to add the following types of assertions:

  • equalIgnoringOrder: compare the contents of arrays without regard to the order of the array elements
  • roughlyEqual: compare two numbers within a threshold amount. Used mostly for floating point numbers to make sure they are close enough
  • contains: make sure all the properties in the expected object also exist in the actual object. The actual object may have more properties. The ones in the expected object must exist, and anything else is optional.

Release Notes

v1.1.0

Added updated assert.deepEqual. The old deepEqual would throw exceptions if one of the two objects passed in were undefined or null. The part of object equality checking which checks if the objects are primitives would dereference the objects to call their valueOf() methods. Of course, you can't dereference undefined or null, so the exception would get thrown.

Keywords

FAQs

Package last updated on 16 Jun 2020

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