Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace <internal>

Index

Type aliases

AnyConstructor

AnyConstructor<Instance, Static>: (new (...input: any[]) => Instance) & SuppressNew<Static>

A type that represents a constructor function, that returns Instance type on instantiation. The properties of the function itself are typed with Static argument. These properties will correspond to the static methods/properties of the class.

Type parameters

  • Instance: object = object

  • Static: object = object

AnyFunction

AnyFunction<Result>: (...input: any[]) => Result

Type parameters

  • Result = any

Type declaration

    • (...input: any[]): Result
    • A type that represents a function with the Result return type.

      Parameters

      • Rest ...input: any[]

      Returns Result

Approximation

Approximation: number | Partial<NumberApproximation> | NumberApproximation

A sum type for various way of specifying the number approximation. Can be either plain number or configuration object for NumberApproximation or NumberApproximation instance.

BeforeAfterHook

BeforeAfterHook<T>: (t: T, next?: AnyFunction) => any

Type parameters

Type declaration

CallInfo

CallInfo: { args: unknown[]; object: unknown; returnValue: unknown }

Type for the individual call information.

Type declaration

  • args: unknown[]

    The arguments of the call.

  • object: unknown

    The scope of the call.

  • returnValue: unknown

    The value, returned by the call.

ProjectPlanItemDescriptor

ProjectPlanItemDescriptor<T>: string | (Partial<T> & {})

This type represents a special placeholder for the TestDescriptor value. It is used as an argument for the various project planning calls, like Project.plan and similar.

The value can be either a string or a partial configuration object of this test's descriptor. That object may have the items property, which is an array of "children" ProjectPlanItemDescriptor entries.

The string value corresponds to the { filename : 'string_value' } object.

Type parameters

TestDescriptorArgument

TestDescriptorArgument<T>: string | Partial<InstanceType<T["testDescriptorClass"]>>

This type represents a special placeholder for the TestDescriptor value. It is used as the 1st argument for the calls that create test sections, like Test.it and similar.

The value can be either a string or a partial configuration object of this test's descriptor.

The string value corresponds to the { title : 'string_value' } object.

Type parameters

WaitForOptions

WaitForOptions<R>: { description: string; interval: number; timeout: number; trigger: AnyFunction; condition: any }

An options object for the waitFor test class method

Type parameters

  • R

Type declaration

  • description: string

    The description for the assertion

  • interval: number

    The polling interval, in milliseconds. The condition checker function is called once for each interval. If not provided the waitForPollInterval will be used.

  • timeout: number

    Maximum amount of time, to wait for condition, in milliseconds. After that time, assertion will be marked as failed. If not provided the waitForTimeout will be used.

  • trigger: AnyFunction

    A trigger function. This function is called once the waiting has started. It allows us to avoid race conditions.

    For example, the typical mistake, which causes the race condition, is to call some method (which will trigger an event) and then start waiting for that event. The event might be triggered synchronously (for example if caching is applied), so it will be already triggered, by the time we start waiting for it.

    In pseudo-code:

    // if caching is applied, the `load` event
    // will be triggered right in this method
    dataStore.loadData()

    // by this time, the event might be already fired
    // so waiting will never complete
    await t.waitForEvent(dataStore, 'load')

    The correct way would be first start waiting for event, and then "trigger" the action, that causes the waiting to complete:

    await t.waitForEvent(dataStore, 'load', {
    trigger : () => dataStore.loadData()
    })

    The trigger function can be asynchronous, if it returns a promise, Siesta will wait until the promise is resolved, before returning from the waiting method.

  • condition:function
    • condition(): OrPromise<R>

Generated using TypeDoc