Documentation
    Preparing search index...

    Namespace TestValidator

    A comprehensive collection of E2E validation utilities for testing applications.

    TestValidator provides type-safe validation functions for common testing scenarios including condition checking, equality validation, error testing, HTTP error validation, pagination testing, search functionality validation, and sorting validation.

    Most functions use direct parameter passing for simplicity, while some maintain currying patterns for advanced composition. All provide detailed error messages for debugging failed assertions.

    Processing cost: Scalar assertions use constant bookkeeping; JSON assertions traverse the expected structure, index compares the shared page prefix, search scans the dataset once per sample and sort checks adjacent results. External callbacks own their computation costs.

    Jeongho Nam - https://github.com/samchon

    // Basic condition testing
    TestValidator.predicate(
    "user should be authenticated",
    user.isAuthenticated,
    );

    // Equality validation
    TestValidator.equals("API response should match expected", x, y);

    // Error validation
    TestValidator.error("should throw on invalid input", () =>
    assertInput(""),
    );

    contracts/common.md#principled-implementation Each validator runs a check and throws an Error whose message begins with Bug on <title>, returning a promise only when its input is asynchronous, so the same function serves synchronous and asynchronous tests; the comparison helpers read values through their JSON form, which is the form an HTTP API delivers.

    contracts/common.md#clear-and-simple-design One function per assertion kind, sharing the JSON comparison (json_equal_to) and two small module helpers (is_promise and is_sorted), with the curried forms only where a request must be prepared once and run twice.

    contracts/common.md#prohibited-implementation-shortcuts Assertions compare the values they are given; none consults a fixture, an entity name, or an environment.

    contracts/common.md#meaningful-documentation The namespace prose lists the assertion families and the error message convention, with examples.

    ISearchProps
    Sortable
    equals
    error
    httpError
    index
    notEquals
    predicate
    sort