assert

Provides generic assertion methods.

contain

Asserts that the string value contains a substring.

Parameters:

NameTypeDescription

actual

String

Actual value.

contains

String

Verbatim string to be contained.

message

String

optional Message to throw if assertion fails.

equal

Asserts that two values are equal (non-strict equality).

Parameters:

NameTypeDescription

actual

Object

Actual value.

expected

Object

Expected value. Either an object or a string prefixed with regex:.

message

String

optional Message to throw if assertion fails.

fail

Fails test with the given message.

Parameters:

NameTypeDescription

message

String

optional Error message to return.

notEqual

Asserts that two values are not equal (non-strict inequality).

Parameters:

NameTypeDescription

actual

Object

Actual value.

expected

Object

Expected value. Either an object or a string prefixed with regex:.

message

String

optional Message to throw if assertion fails.

pass

Passes the test with the given message.

Parameters:

NameTypeDescription

message

String

optional Message to return.

Last updated