Base

module:Base

Source:

Expose Base.

Members

module:Base

Source:

Expose Base.

(static) colors

Source:

Default color map.

(static) cursor

Source:

Expose some basic cursor interactions that are common among reporters.

(static) inlineDiffs

Source:

Inline diffs instead of +/-

(static) symbols

Source:

Default symbol map.

(static) useColors

Source:

Enable coloring by default, except in the browser interface.

(static) window

Source:

Expose term window size, with some defaults for when stderr is not a tty.

(inner) color

Source:

Color str with the given type,
allowing colors to be disabled,
as well as user-defined color
schemes.

(inner) generateDiff

Source:

Returns a diff between 2 strings with coloured ANSI output.

The diff will be either inline or unified dependant on the value
of Base.inlineDiff.

(inner) isatty

Source:

Check if both stdio streams are associated with a tty.

(inner) objToString

Source:

Object#toString reference.

(inner) tty

Source:

Module dependencies.

Methods

(inner) colorLines(name, str) → {string}

Source:

Color lines for str, using the color name.

Parameters:
NameTypeDescription
namestring
strstring
Returns:
Type
string

(inner) errorDiff(actual, expected) → {string}

Source:

Return a character diff for err.

Parameters:
NameTypeDescription
actualString
expectedString
Returns:

the diff

Type
string

(inner) inlineDiff(actual, expected) → {string}

Source:

Returns an inline diff between 2 strings with coloured ANSI output.

Parameters:
NameTypeDescription
actualString
expectedString
Returns:

Diff

Type
string

(inner) pad(str, len) → {string}

Source:

Pad the given str to len.

Parameters:
NameTypeDescription
strstring
lenstring
Returns:
Type
string

(inner) sameType(a, b) → {boolean}

Source:

Check that a / b have the same type.

Parameters:
NameTypeDescription
aObject
bObject
Returns:
Type
boolean

(inner) unifiedDiff(actual, expected) → {string}

Source:

Returns a unified diff between two strings with coloured ANSI output.

Parameters:
NameTypeDescription
actualString
expectedString
Returns:

The diff.

Type
string