Options for dynamic executor.

interface IProps<Parameters extends any[], Ret = any> {
    extension?: string;
    filter?: (name: string) => boolean;
    location: string;
    onComplete?: (exec: IExecution) => void;
    parameters: (name: string) => Parameters;
    prefix: string;
    wrapper?: (
        name: string,
        closure: DynamicExecutor.Closure<Parameters, Ret>,
        paramters: Parameters,
    ) => Promise<any>;
}

Type Parameters

  • Parameters extends any[]
  • Ret = any

Properties

extension?: string

Extension of dynamic functions.

js
filter?: (name: string) => boolean

Filter function whether to run or not.

Type declaration

    • (name: string): boolean
    • Parameters

      • name: string

        Function name

      Returns boolean

      Whether to run or not

location: string

Location of the test functions.

onComplete?: (exec: IExecution) => void

On complete function.

Listener of completion of a test function.

Type declaration

parameters: (name: string) => Parameters

Get parameters of a function.

Type declaration

prefix: string

Prefix of function name.

Every prefixed function will be executed.

In other words, if a function name doesn't start with the prefix, then it would never be executed.

wrapper?: (
    name: string,
    closure: DynamicExecutor.Closure<Parameters, Ret>,
    paramters: Parameters,
) => Promise<any>

Wrapper of test function.

If you specify this wrapper property, every dynamic functions loaded and called by this DynamicExecutor would be wrapped by the wrapper function.

Type declaration