assertion-error-formatter

WebJar for assertion-error-formatter

License

License

MIT
Categories

Categories

ORM Data
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

assertion-error-formatter
Last Version

Last Version

2.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

assertion-error-formatter
WebJar for assertion-error-formatter
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/charlierudolph/node-assertion-error-formatter

Download assertion-error-formatter

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/assertion-error-formatter/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>assertion-error-formatter</artifactId>
    <version>2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/assertion-error-formatter/
implementation 'org.webjars.npm:assertion-error-formatter:2.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/assertion-error-formatter/
implementation ("org.webjars.npm:assertion-error-formatter:2.0.1")
'org.webjars.npm:assertion-error-formatter:jar:2.0.1'
<dependency org="org.webjars.npm" name="assertion-error-formatter" rev="2.0.1">
  <artifact name="assertion-error-formatter" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='assertion-error-formatter', version='2.0.1')
)
libraryDependencies += "org.webjars.npm" % "assertion-error-formatter" % "2.0.1"
[org.webjars.npm/assertion-error-formatter "2.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : diff jar [3.0.0,4)
org.webjars.npm : pad-right jar [0.2.2,0.3)
org.webjars.npm : repeat-string jar [1.6.1,2)

Project Modules

There are no modules declared in this project.

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

Versions

Version
2.0.1
2.0.0