Endo API documentation
    Preparing search index...

    Interface AssertionFunctions

    interface AssertionFunctions {
        typeof: AssertTypeof;
        equal<T>(
            actual: unknown,
            expected: T,
            details?: Details,
            errConstructor?: GenericErrorConstructor,
            options?: AssertMakeErrorOptions,
        ): asserts actual is T;
        fail(
            details?: Details,
            errConstructor?: GenericErrorConstructor,
            options?: AssertMakeErrorOptions,
        ): never;
        string(specimen: any, details?: Details): asserts specimen is string;
        (
            flag: any,
            details?: Details,
            errConstructor?: GenericErrorConstructor,
            options?: AssertMakeErrorOptions,
        ): asserts flag;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Methods

    Properties

    typeof: AssertTypeof

    Methods

    • The assert.fail method.

      Fail an assertion, recording full details to the console and raising an exception with a message in which details substitution values have been redacted.

      The optional optDetails can be a string for backwards compatibility with the nodejs assertion library.

      Parameters

      Returns never

    • The assert.string method.

      assert.string(v) is equivalent to assert.typeof(v, 'string'). We special case this one because it is the most frequently used.

      Assert an expected typeof result.

      Parameters

      • specimen: any
      • Optionaldetails: Details

        The details of what was asserted

      Returns asserts specimen is string