Members
(static) Version
- Description:
- Returns the version of the test library. This is a read-only property used for diagnostics or compatibility checks.
- Source:
Returns the version of the test library.
This is a read-only property used for diagnostics or compatibility checks.
Methods
(static) areEqual(testName, expected, actual, compareropt, writeopt, nullable) → {boolean}
- Description:
- Asserts strict equality - checks if `actual === expected`, or uses a custom comparer if provided.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
expected |
* | Expected value. | |
actual |
* | Actual value to compare. | |
comparer |
function |
<optional> |
Optional custom comparison function ((expected, actual) => boolean). |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean
(static) areNotEqual(testName, not_expected, actual, compareropt, writeopt, nullable) → {boolean}
- Description:
- Asserts strict inequality - checks if `actual !== not_expected`, or uses a custom comparer if provided.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
not_expected |
* | The value we not expecting. | |
actual |
* | Actual value to compare. | |
comparer |
function |
<optional> |
Optional custom comparison function ((not_expected, actual) => boolean). |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean
(static) isDefined(testName, actual, writeopt, nullable) → {boolean}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
actual |
* | Value to assert is defined. | |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean
(static) isFalse(testName, actual, writeopt, nullable) → {boolean}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
actual |
* | Value to assert is `false`. | |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean
(static) isNotNull(testName, actual, writeopt, nullable) → {boolean}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
actual |
* | Value to assert is not `null`. | |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean
(static) isNull(testName, actual, writeopt, nullable) → {boolean}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
actual |
* | Value to assert is `null`. | |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean
(static) isTrue(testName, actual, writeopt, nullable) → {boolean}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
actual |
* | Value to assert is `true`. | |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean
(static) isUndefined(testName, actual, writeopt, nullable) → {boolean}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
actual |
* | Value to assert is `undefined`. | |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean
(static) noThrows(testName, fn, thisArgopt, writeopt, nullable) → {boolean}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
fn |
function | Function expected to execute without throwing. | |
thisArg |
object |
<optional> |
Optional `this` binding for `fn`. |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean
(static) sequencesAreEqual(testName, expected, actual, itemCompareropt, writeopt, nullable) → {boolean}
- Description:
- Adds a sequence equality assertion to the group. Compares two iterable sequences element-by-element.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
expected |
Iterable | The expected iterable sequence. | |
actual |
Iterable | The actual iterable sequence. | |
itemComparer |
function |
<optional> |
Optional custom item-level comparison function ((expected, actual) => boolean). |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean
(static) throws(testName, fn, checkErrorFnopt, thisArgopt, writeopt, nullable) → {boolean}
- Description:
- Adds an assertion that verifies a function throws an error. Optionally verifies the error with a predicate.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
testName |
string | Descriptive test title. | |
fn |
function | Function expected to throw. | |
checkErrorFn |
function |
<optional> |
Optional predicate to inspect the thrown error. |
thisArg |
object |
<optional> |
Optional `this` binding for `fn` and `checkErrorFn`. |
write |
boolean |
<optional> <nullable> |
The write mode: true - log all; false - don't log anything; null (or undefined) - log only errors. |
Returns:
True if the test succeeded; otherwise, false.
- Type
- boolean