corde
Version:
A simple library for Discord bot tests
40 lines (39 loc) • 1.44 kB
TypeScript
import { Queue } from "../data-structures";
import { IAssertionProps, IGroup, ITest, TestFunctionType, VoidLikeFunction } from "../types";
/**
* Contain all information of data collected from files in runtime test
* collection.
* @internal
*/
declare class TestCollector {
private constructor();
private static _instance;
isInsideGroupClausure: boolean;
isInsideTestClausure: boolean;
assertions: IAssertionProps[];
tests: ITest[];
groups: IGroup[];
beforeStartFunctions: Queue<VoidLikeFunction>;
afterAllFunctions: Queue<VoidLikeFunction>;
beforeEachFunctions: Queue<VoidLikeFunction>;
afterEachFunctions: Queue<VoidLikeFunction>;
testsFunctions: TestFunctionType[];
isolatedFunctions: TestFunctionType[];
private testClousureFunction;
private groupClousureFunction;
static getInstance(): TestCollector;
addTestFunction(testFunction: TestFunctionType): void;
isInsideTestClausureFunctions(): boolean;
hasIsolatedTestFunctions(): boolean;
cloneTestFunctions(): TestFunctionType[];
cloneIsolatedTestFunctions(): TestFunctionType[];
clearTestFunctions(): void;
clearIsolatedTestFunctions(): void;
cleanAll(): void;
addToGroupClousure(fn: () => void | Promise<void>): void;
executeGroupClojure(): Promise<any[]>;
addToTestClousure(fn: () => void | Promise<void>): void;
executeTestClojure(): Promise<any[]>;
}
declare const testCollector: TestCollector;
export { testCollector };