A type that represents a function with the Result
return type.
A sum type for various way of specifying the number approximation. Can be either plain number or configuration object for NumberApproximation or NumberApproximation instance.
The type for test's before/after hooks, which can be created with Test.beforeEach/Test.afterEach
Type for the individual call information.
The arguments of the call.
The scope of the call.
The value, returned by the call.
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.
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.
An options object for the waitFor test class method
The description for the assertion
The polling interval, in milliseconds. The condition checker function is called once for each interval. If not provided the waitForPollInterval will be used.
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.
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.
A condition checker function. Can be async
. Should return some "truthy" value, indicating the condition has been met.
This value will be returned from the waitFor assertion itself.
Generated using TypeDoc
A type that represents a constructor function, that returns
Instance
type on instantiation. The properties of the function itself are typed withStatic
argument. These properties will correspond to the static methods/properties of the class.