diff --git a/README.md b/README.md
index cd960c3..9f0e597 100644
--- a/README.md
+++ b/README.md
@@ -200,6 +200,8 @@ runner.exec("My Test Name", () => {
Assert.equals(1 + 1, 2)
}, 2) // The '2' is the indent level for this test (prints if verbosity >= 2)
```
+**Note:**
+When using `TestRunner.exec`, always pass the test code as a function reference (e.g., `() => ...` or `function() { ... }`). This ensures the test is executed at the correct time within the `exec` method, preserving the intended order of output and test execution. Passing a direct function call (e.g., `runner.exec("Test", myTestFunction())`) will execute the test immediately—before `exec` can manage output or error handling—leading to unexpected results such as out-of-order titles or missed error reporting.
#### Structured Output
diff --git a/docs/typedoc/classes/Assert.html b/docs/typedoc/classes/Assert.html
index df63d5f..4020205 100644
--- a/docs/typedoc/classes/Assert.html
+++ b/docs/typedoc/classes/Assert.html
@@ -2,7 +2,7 @@
This class provides a set of static methods to perform common assertions
such as checking equality, type, and exceptions, etc. In case of assertion failure,
an AssertionError is thrown and the user can provide a descriptive message.
StaticdoesStaticdoesAsserts that the provided function does NOT throw an error.
If an error is thrown, an AssertionError is thrown with the provided message or details of the error.
A function that is expected to NOT throw.
Must be passed as a function reference, e.g. () => codeThatShouldNotThrow().
Assert.throws for the opposite assertion.
-StaticequalsAsserts that two values are equal by type and value. +
StaticequalsAsserts that two values are equal by type and value.
Supports comparison of primitive types, one-dimensional arrays of primitives,
and one-dimensional arrays of objects (deep equality via JSON.stringify).
If the values differ, a detailed error is thrown.
For arrays, mismatches include index, value, and type.
For arrays of objects, a shallow comparison using JSON.stringify is performed.
-If a value cannot be stringified (e.g., due to circular references), it is treated as "[unprintable value]" in error messages and object equality checks.
[unprintable value] in error messages and object equality checks.
T if the assertion passes.T if the assertion passes.AssertionError - If 'actual' and 'expected' are not equal.
+Assert.equals(2 + 2, 4, "Simple math")
Assert.equals(["a", "b"], ["a", "b"], "Array match")
Assert.equals([1, "2"], [1, 2], "Array doesn't match") // Fails
Assert.equals([{x:1}], [{x:1}], "Object array match") // Passes
Assert.equals([{x:1}], [{x:2}], "Object array mismatch") // Fails
Assert.notEquals for the opposite assertion.
-StaticfailFails the test by throwing an error with the provided message. +
StaticfailFails the test by throwing an error with the provided message. This method is used to explicitly indicate that a test case has failed, regardless of any conditions or assertions.
Optionalmessage: string(Optional) The failure message to display. -If not provided, a default "Assertion failed" message is used.
+If not provided, a defaultAssertion failed message is used.
StaticisAsserts that the given value is defined (not undefined).
+
StaticisAsserts that the given value is defined (not undefined).
Alias for isNotUndefined method.
The value to check.
(Optional) Message to prefix in case of failure.
@@ -92,7 +92,7 @@StaticisAsserts that the provided value is falsy. +
StaticisAsserts that the provided value is falsy.
Throws AssertionError if the value is not falsy.
The value to test for falsiness.
(Optional) Message to prefix in case of failure.
@@ -104,7 +104,7 @@Assert.isTrue for the opposite assertion.
-StaticisAsserts that the value is an instance of the specified constructor. +
StaticisAsserts that the value is an instance of the specified constructor.
Throws AssertionError if not.
The value to check.
The class/constructor function.
@@ -117,7 +117,7 @@Assert.isNotInstanceOf for the opposite assertion.
-StaticisAsserts that the value is NOT an instance of the specified constructor. +
StaticisAsserts that the value is NOT an instance of the specified constructor.
Throws AssertionError if it is.
The value to check.
The class/constructor function.
@@ -130,14 +130,14 @@Assert.isInstanceOf for the opposite assertion.
-StaticisAsserts that the given value is not null.
+
StaticisAsserts that the given value is not null.
Provides a robust stringification of the value for error messages,
guarding against unsafe or error-throwing toString() implementations.
-Narrows the type of 'value' to NonNullable
NonNullable<T> if assertion passes.
The value to test.
Optional message to prefix in case of failure.
NonNullable<T> if the assertion passes.Assert.isNotNull(42, "Value should not be null")
Assert.isNotNull(null, "Value should be null") // Fails
@@ -147,7 +147,7 @@
- Assert.isNull for the opposite assertion.
- Assert.isDefined for an alias that checks for defined values (not
null or undefined).
-StaticisStaticisAsserts that a value is NOT of the specified primitive type.
The value to check.
The unwanted type as a string (string, number, etc.)
Optional error message.
@@ -161,8 +161,8 @@This method checks the type using typeof and throws an AssertionError if the type matches.
The type parameter must be one of the following strings: string, number, boolean, object, function, undefined, symbol, or bigint.
Assert.isType for the positive assertion.
-StaticisAsserts that the given value is not undefined.
-Narrows the type to exclude undefined.
+
StaticisAsserts that the given value is not undefined.
+Narrows the type to exclude undefined.
Throws AssertionError if the value is undefined.
The value to check.
(Optional) Message to prefix in case of failure.
@@ -177,7 +177,7 @@undefined).StaticisAsserts that the given value is strictly null.
+
StaticisAsserts that the given value is strictly null.
Provides a robust stringification of the value for error messages,
guarding against unsafe or error-throwing toString() implementations.
The value to test.
@@ -190,19 +190,19 @@Assert.isDefined for an alias that checks for defined values (not null or undefined).
StaticisAsserts that the provided value is truthy. +
StaticisAsserts that the provided value is truthy.
Throws AssertionError if the value is not truthy.
The value to test for truthiness.
(Optional) Message to prefix in case of failure.
Assert.isTrue(1 < 2, "Math sanity")
Assert.isTrue("non-empty string", "String should be truthy")
Assert.isFalse for the opposite assertion.
-StaticisStaticisAsserts that a value is of the specified primitive type.
The value to check.
The expected type as a string (string, number, etc.)
Optional error message.
@@ -218,12 +218,12 @@ Thetype parameter must be one of the following strings: string, number, boolean, object, function, undefined, symbol, or bigint.
If the value is null, it will be considered an object, which is consistent with JavaScript's behavior.
Assert.isNotType for the opposite assertion.
-StaticisAsserts that the given value is strictly undefined.
+
StaticisAsserts that the given value is strictly undefined.
Throws AssertionError if the value is not exactly undefined.
The value to check.
(Optional) Message to prefix in case of failure.
undefined if the assertion passes.undefined if the assertion passes.Assert.isUndefined(void 0)
Assert.isUndefined(undefined)
Assert.isUndefined(null, "Null is not undefined") // Fails
@@ -233,7 +233,7 @@
- Assert.isNotUndefined for the opposite assertion.
- Assert.isDefined for an alias that checks for defined values (not
undefined).
-StaticnotAsserts that two values are not equal (deep comparison). +
StaticnotAsserts that two values are not equal (deep comparison).
For arrays and objects, uses deep comparison (via JSON.stringify).
Throws AssertionError if the values are equal.
The actual value.
@@ -247,7 +247,7 @@Assert.equals for the opposite assertion.
-StaticthrowsStaticthrowsAsserts that the provided function throws an error. Optionally checks the error type and message.
A function that is expected to throw an error.
Must be passed as a function reference, e.g. () => codeThatThrows().
OptionalexpectedMessage: string(Optional) Exact expected error message.
(Optional) Additional prefix for the error message if the assertion fails.
AssertionError - If no error is thrown, or if the thrown error does not match the expected type or message.
Assert.throws(() => {
throw new TypeError("Invalid")
}, TypeError, "Invalid", "Should throw TypeError")
Assert.doesNotThrow for the opposite assertion.
-
Asserts that the provided function does NOT throw an error. +