Methods
(static) array(arrayValue, messageopt)
Asserts that a given value is an array.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arrayValue |
array
|
The value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) boolean(booleanValue, messageopt)
Validates that a given value is a boolean.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
booleanValue |
boolean
|
The value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) count(expectedCount, arrayValue, messageopt)
Asserts that the length of a given array matches an expected count.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expectedCount |
int
|
The number that the length of the array is expected to match. |
|
arrayValue |
array
|
The array whose length is being checked against the expected count. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) equal(value, expectedValue, messageopt)
Asserts that a given value is equal to an expected value.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
*
|
The value to be compared. This can be of any type. |
|
expectedValue |
*
|
The value against which the first parameter is compared. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) evenNumber(integerValue, messageopt)
Asserts that a given integer value is an even number.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
integerValue |
int
|
The integer value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) false(value, messageopt)
Validates that a given value is false.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
boolean
|
The value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) greaterThan(expected, integerValue, messageopt)
Asserts that a given integer value is greater than an expected integer value.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expected |
int
|
The integer value that the integerValue is expected to be greater than. |
|
integerValue |
int
|
The integer value to be tested against the expected value. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) greaterThanOrEqual(expected, integerValue, messageopt)
Asserts that a given integer value is greater or equal than an expected integer value.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expected |
int
|
The integer value that the integerValue is expected to be greater or equal than. |
|
integerValue |
int
|
The integer value to be tested against the expected value. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) hasFunction(expectedFunctionName, objectValue, messageopt)
Asserts that a given object has a function of a specified name.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expectedFunctionName |
string
|
The name of the function expected to be present in the object. |
|
objectValue |
object
|
The object to be checked for the presence of the specified function. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) hasProperty(expectedPropertyName, objectValue, messageopt)
Asserts that a given object has a specific property.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expectedPropertyName |
string
|
The name of the property expected to be present in the object. |
|
objectValue |
object
|
The object to be checked for the presence of the specified property. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) instanceOf(objectValue, expectedInstance, messageopt)
Asserts that a given object is an instance of a specified class.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
objectValue |
object
|
The object to be tested against the expected instance. |
|
expectedInstance |
function
|
The constructor function that the value is expected to be an instance of. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) integer(integerValue, messageopt)
Validates that a given value is an integer.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
integerValue |
int
|
The value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) isFunction(functionValue, messageopt)
Asserts that a given value is a function.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
functionValue |
function
|
The value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) lessThan(expected, integerValue, messageopt)
Asserts that a given integer value is less than an expected integer value.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expected |
int
|
The integer value that the integerValue is expected to be less than. |
|
integerValue |
int
|
The integer value to be tested to ensure it is less than the expected value. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) lessThanOrEqual(expected, integerValue, messageopt)
Asserts that a given integer value is less or equal than an expected integer value.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expected |
int
|
The integer value that the integerValue is expected to be less or equal than. |
|
integerValue |
int
|
The integer value to be tested against the expected value. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) notEmpty(value, messageopt)
Asserts that a given value is not empty.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
*
|
The value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) number(numberValue, messageopt)
Validates that a given value is a number.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
numberValue |
number
|
The value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) object(objectValue, messageopt)
Asserts that a given value is of type 'object'.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
objectValue |
object
|
The value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) objectEqual(object, expectedObject, messageopt)
Asserts that two objects are equal by comparing their properties.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
object |
object
|
The object to be compared. |
|
expectedObject |
object
|
The object expected to be equal to the first object. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) oddNumber(integerValue, messageopt)
Asserts that a given integer value is an odd number.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
integerValue |
int
|
The integer value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) string(stringValue, messageopt)
Validates that a given value is a string.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stringValue |
string
|
The value to be checked. |
|
message |
string
|
<optional> |
A custom error message to be used if the assertion fails. |
(static) throws(callback, expectedErroropt)
Asserts that a function throws an error.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function
|
The function expected to throw an error when invoked. |
|
expectedError |
object
|
<optional> |
An Error object representing the expected error. |