Socket
Socket
Sign inDemoInstall

assertion-error-formatter

Package Overview
Dependencies
3
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    assertion-error-formatter

Format errors to display a diff between the actual and expected


Version published
Weekly downloads
1.2M
increased by2.9%
Maintainers
1
Install size
369 kB
Created
Weekly downloads
 

Readme

Source

Node Assertion Error Formatter

Format errors to display a diff between the actual and expected

Originally extracted from mocha

Usage

import {format} from 'assertion-error-formatter'

format(error)

API Reference

format(error [, options])
  • error: a javascript error
  • options: An object with the following keys:
    • colorFns: An object with the keys 'diffAdded', 'diffRemoved', 'errorMessage', 'errorStack'. The values are functions to colorize a string, each defaults to identity.
    • inlineDiff: boolean (default: false)
      • toggle between inline and unified diffs

FAQs

Last updated on 21 Aug 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc