EndoJS
    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;
        (
            condition: any,
            details?: Details,
            errConstructor?: GenericErrorConstructor,
            options?: AssertMakeErrorOptions,
        ): asserts condition;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Methods

    Properties

    typeof: AssertTypeof

    Methods

    • Assert that two values are the same as observed by Object.is.

      Type Parameters

      • T

      Parameters

      • actual: unknown

        What we received

      • expected: T

        What we wanted

      • Optionaldetails: Details

        The details associated with assertion failure (Object.is returning false)

      • OptionalerrConstructor: GenericErrorConstructor

        An optional alternate error constructor to use

      • Optionaloptions: AssertMakeErrorOptions

      Returns asserts actual is T

    • Assert that a value is a primitive string. assert.string(v) is equivalent to assert.typeof(v, 'string'). We special case this one because it is the most frequently used.

      Parameters

      • specimen: any
      • Optionaldetails: Details

        The details of what was asserted

      Returns asserts specimen is string