Documentation
    Preparing search index...

    Interface IProps<Parameters, Ret>

    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;
        simultaneous?: number;
        wrapper?: (
            name: string,
            closure: DynamicExecutor.Closure<Parameters, Ret>,
            parameters: Parameters,
        ) => Promise<any>;
    }

    Type Parameters

    • Parameters extends any[]
    • Ret = any
    Index

    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.

    simultaneous?: number

    Number of simultaneous requests.

    The number of requests to be executed simultaneously.

    If you configure a value greater than one, the dynamic executor will process the functions concurrently with the given capacity value.

    1
    
    wrapper?: (
        name: string,
        closure: DynamicExecutor.Closure<Parameters, Ret>,
        parameters: 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