@serenity-is/corelib / scriptDataHooks

Variable: scriptDataHooks

const scriptDataHooks: object

Defined in: src/base/scriptdata.ts:50

Hook for script data related operations

Type Declaration

fetchScriptData()

fetchScriptData: <TData>(name, sync?, dynJS?) => TData | Promise<TData>

Provides a hook to override the default fetchScriptData implementation, it falls back to the default implementation if undefined is returned. It is recommended to use this hook mainly for test purposes. If the sync parameter is true (legacy/compat), then the result should be returned synchronously. DynJS parameter is true if the script is requested to be loaded via a dynamic script, and not a JSON request. This parameter is only true for the legacy/compat sync mode.

Type Parameters

TData

TData

Parameters

name

string

sync?

boolean

dynJS?

boolean

Returns

TData | Promise<TData>