Skip to main content

Function: installGlobalPlugin()

installGlobalPlugin(plugin): void

Defined in: packages/fast-check/src/check/runner/configuration/GlobalPlugins.ts:26

Install a plugin to be used by all the runners Installed plugins come before the ones passed via the plugins option of the run.

In other words, they are the outermost ones: they are entered first when running the predicate. Think of: outer(inner(predicate)).

Parameters

ParameterTypeDescription
pluginPlugin<unknown>Plugin to be installed globally

Returns

void

Example

fc.installGlobalPlugin(myPlugin());
//...
fc.assert(myProp, { plugins: [myOtherPlugin()] })
// equivalent to { plugins: [myPlugin(), myOtherPlugin()] }
// myPlugin will wrap myOtherPlugin, itself wrapping the default behavior

Remarks

Since 4.10.0