UNPKG

gremlins-ts

Version:

A monkey testing library written in JavaScript, for Node.js and the browser. Use it to check the robustness of web applications by unleashing a horde of undisciplined gremlins.

37 lines (36 loc) 1.22 kB
/// <reference types="chance" /> import { CustomGremlin, CustomMogwai, CustomStrategy, CustomCallback } from "./types"; export declare const gremlins: { species: { [key: string]: () => CustomGremlin; }; mogwais: { [key: string]: () => CustomMogwai; }; strategies: { [key: string]: CustomStrategy; }; createHorde: () => GremlinsHorde; }; export declare class GremlinsHorde { _gremlins: Array<CustomGremlin>; _mogwais: Array<CustomMogwai>; _strategies: Array<CustomStrategy>; _beforeCallbacks: Array<CustomCallback>; _afterCallbacks: Array<CustomCallback>; _logger: typeof console; _randomizer: Chance.Chance; gremlin(gremlin: CustomGremlin): this; allGremlins(): this; mogwai(mogwai: CustomMogwai): this; allMogwais(): this; strategy(strategy: CustomStrategy): this; before(beforeCallback: CustomCallback): this; after(afterCallback: CustomCallback): this; logger(logger?: typeof console): Console | this; log(msg: string): void; randomizer(randomizer?: Chance.Chance): Chance.Chance | this; seed(seed: number): this; unleash(params: object, done: CustomCallback): void; stop(): void; }