assertion-error-formatter
Format errors to display a diff between the actual and expected
Last updated 9 years ago by charlierudolph .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install assertion-error-formatter 
SYNC missed versions from official npm registry.

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

Current Tags

  • 3.0.0                                ...           latest (7 years ago)

6 Versions

  • 3.0.0                                ...           7 years ago
  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 19
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 0
Last Month 6
Dependencies (3)
Dev Dependencies (12)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE