assert

Provides generic assertion methods.

contain

Asserts that the string value contains a substring.

Parameters:

Name
Type
Description

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:

Name
Type
Description

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:

Name
Type
Description

message

String

optional Error message to return.

notEqual

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

Parameters:

Name
Type
Description

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:

Name
Type
Description

message

String

optional Message to return.

Last updated