UNPKG

2.36 kBTypeScriptView Raw
1export { production } from "./environment.js";
2export const extensive: boolean;
3export const envSeed: number | null;
4export class TestCase {
5 /**
6 * @param {string} moduleName
7 * @param {string} testName
8 */
9 constructor(moduleName: string, testName: string);
10 /**
11 * @type {string}
12 */
13 moduleName: string;
14 /**
15 * @type {string}
16 */
17 testName: string;
18 _seed: number | null;
19 _prng: prng.PRNG | null;
20 resetSeed(): void;
21 /**
22 * @type {number}
23 */
24 get seed(): number;
25 /**
26 * A PRNG for this test case. Use only this PRNG for randomness to make the test case reproducible.
27 *
28 * @type {prng.PRNG}
29 */
30 get prng(): prng.PRNG;
31}
32export const repetitionTime: number;
33export function run(moduleName: string, name: string, f: (arg0: TestCase) => void | Promise<any>, i: number, numberOfTests: number): Promise<boolean>;
34export function describe(description: string, info?: string): void;
35export function info(info: string): void;
36export const printDom: (createNode: () => Node) => void;
37export const printCanvas: (canvas: HTMLCanvasElement, height: number) => void;
38export function group(description: string, f: (arg0: void) => void): void;
39export function groupAsync(description: string, f: (arg0: void) => Promise<any>): Promise<void>;
40export function measureTime(message: string, f: () => void): number;
41export function measureTimeAsync(message: string, f: () => Promise<any>): Promise<number>;
42export function compareArrays<T>(as: T[], bs: T[], m?: string | undefined): boolean;
43export function compareStrings(a: string, b: string, m?: string | undefined): void;
44export function compareObjects<K, V>(a: any, b: any, m?: string | undefined): void;
45export function compare<T>(a: T, b: T, message?: string | null | undefined, customCompare?: ((arg0: any, arg1: T, arg2: T, arg3: string, arg4: any) => boolean) | undefined): boolean;
46export function assert(condition: boolean, message?: string | null | undefined): true;
47export function fails(f: () => void): void;
48export function runTests(tests: {
49 [x: string]: {
50 [x: string]: (arg0: TestCase) => void | Promise<any>;
51 };
52}): Promise<boolean>;
53export function fail(reason: string): never;
54export function skip(cond?: boolean): void;
55import * as prng from "./prng.js";
56//# sourceMappingURL=testing.d.ts.map
\No newline at end of file