Namespace: assertx

assertx

Classes

AssertionError

Members

<static> utilx :object

The Javascript library that assert-x is built on for cross environment compatability.
Type:
  • object
Source:

Methods

<static> deepEqual(actual, expected, message, stackStartFunction) → {undefined}

Tests for deep equality, coercive equality with the equal comparison operator ( == ) and equivalent.
Parameters:
Name Type Argument Description
actual *
expected *
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> deepStrictEqual(actual, expected, message, stackStartFunction) → {undefined}

Tests for deep strict equality, equality with the strict equal comparison operator ( === ) and equivalent.
Parameters:
Name Type Argument Description
actual *
expected *
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> doesNotThrow(block, message, stackStartFunction) → {undefined}

Expects block not to throw an error, see assert.throws for details.
Parameters:
Name Type Argument Description
block function
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> equal(actual, expected, message, stackStartFunction) → {undefined}

Tests shallow, coercive equality with the equal comparison operator ( == ).
Parameters:
Name Type Argument Description
actual *
expected *
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> fail(actual, expected, message, stackStartFunction) → {undefined}

Throws an exception that displays the values for actual and expected.
Parameters:
Name Type Argument Description
actual *
expected *
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> ifError(err) → {undefined}

Tests if value is not a falsy value, throws if it is a truthy value. Useful when testing the first argument, error in callbacks.
Parameters:
Name Type Description
err *
Source:
Returns:
Type
undefined

<static> notDeepEqual(actual, expected, message, stackStartFunction) → {undefined}

Tests for deep inequality.
Parameters:
Name Type Argument Description
actual *
expected *
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> notDeepStrictEqual(actual, expected, message, stackStartFunction) → {undefined}

Tests for deep strict inequality.
Parameters:
Name Type Argument Description
actual *
expected *
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> notEqual(actual, expected, message, stackStartFunction) → {undefined}

Tests shallow, coercive non-equality with the not equal comparison operator ( != ).
Parameters:
Name Type Argument Description
actual *
expected *
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> notOk(value, message, stackStartFunction) → {undefined}

Tests if value is truthy, it is equivalent to assert.equal(!value, true, message);
Parameters:
Name Type Argument Description
value *
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> notStrictEqual(actual, expected, message, operator, stackStartFunction) → {undefined}

Tests strict non-equality, as determined by the strict not equal operator ( !== ).
Parameters:
Name Type Argument Description
actual *
expected *
message string
operator string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> ok(value, message, stackStartFunction) → {undefined}

Tests if value is truthy, it is equivalent to assert.equal(!!value, true, message);
Parameters:
Name Type Argument Description
value *
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> strictEqual(actual, expected, message, stackStartFunction) → {undefined}

Tests strict equality, as determined by the strict equality operator ( === ).
Parameters:
Name Type Argument Description
actual *
expected *
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined

<static> throws(block, error, message, stackStartFunction) → {undefined}

Expects block to throw an error. error can be constructor, regexp or validation function.
Parameters:
Name Type Argument Description
block function
error constructor | regexp | function
message string
stackStartFunction function <optional>
Source:
Returns:
Type
undefined