Module assert

Assertion library covering CommonJS Unit Testing.

Functions

Class ArgumentsError

Instance Properties


ArgumentsError (message)

Creates a new ArgumentsError instance

Parameters

String message The exception message

Returns

A newly created ArgumentsError instance

ArgumentsError.prototype.message


ArgumentsError.prototype.stackTrace


deepEqual (actual, expected)

Checks if the values passed as arguments are deep equal

Parameters

Object actual The actual value
Object expected The expected value

Throws

ArgumentsError, AssertionError

equal (actual, expected)

Checks if the values passed as arguments are equal.

Parameters

Object actual The actual value
Object expected The expected value

Throws

ArgumentsError, AssertionError

notDeepEqual (actual, expected)

Checks if the values passed as arguments are not deep equal

Parameters

Object actual The actual value
Object expected The expected value

Throws

ArgumentsError, AssertionError

notEqual (actual, expected)

Checks if the values passed as arguments are not equal.

Parameters

Object actual The actual value
Object expected The expected value

Throws

ArgumentsError, AssertionError

notStrictEqual (actual, expected)

Checks if the values passed as arguments are not strictly equal

Parameters

Object actual The actual value
Object expected The expected value

Throws

ArgumentsError, AssertionError

ok (value)

Checks if the value passed as argument is truthy.

Parameters

Object value The value to check for truthiness

Throws

ArgumentsError, AssertionError

strictEqual (actual, expected)

Checks if the values passed as arguments are strictly equal

Parameters

Object actual The actual value
Object expected The expected value

Throws

ArgumentsError, AssertionError

throws (func, expectedError)

Checks if the function passed as argument throws a defined exception.

Parameters

Object func The function to call
Object expectedError Optional object expected to be thrown when executing the function

Throws

ArgumentsError, AssertionError