1.2.0 • Published 6 years ago

power-assert-renderer-comparison v1.2.0

Weekly downloads
150,530
License
MIT
Repository
github
Last release
6 years ago

power-assert

Build Status NPM version License

Produces comparison of expected and actual values of BinaryExpression.

  assert(a.name === 'bar')
  --- [string] 'bar'
  +++ [string] a.name
  @@ -1,3 +1,3 @@
  -bar

USAGE

var ComparisonRenderer = require('power-assert-renderer-comparison');

options.stringify

typedefault value
functionstringifier module

Function to stringify any target value.

options.maxDepth

typedefault value
number2

Depth of object traversal. If object depth is greater than maxDepth, compound object (IOW, Array or object) will be pruned with # like ["foo",#Array#,#Object#].

options.lineSeparator

typedefault value
string"\n"

Line separator in power assert output.

options.anonymous

typedefault value
string"Object"

Type name to show when target object is created by anonymous constructor.

options.circular

typedefault value
string"#@Circular#"

Name to show when target object is detected as circular structure.

options.diff

typedefault value
functionudiff.js

Function to create diff string between two strings.

options.lineDiffThreshold

typedefault value
number5

Threshold to show diff at character level or line level. If number of lines in target string is greater than lineDiffThreshold, then line diff mode will be used to show diff output.

INSTALL

$ npm install --save-dev power-assert-renderer-comparison

AUTHOR

LICENSE

Licensed under the MIT license.