UNPKG

2.75 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 /**
19 * This type can store custom information related to the TestCase
20 *
21 * @type {Map<string,any>}
22 */
23 meta: Map<string, any>;
24 _seed: number | null;
25 _prng: prng.PRNG | null;
26 resetSeed(): void;
27 /**
28 * @type {number}
29 */
30 get seed(): number;
31 /**
32 * A PRNG for this test case. Use only this PRNG for randomness to make the test case reproducible.
33 *
34 * @type {prng.PRNG}
35 */
36 get prng(): prng.PRNG;
37}
38export const repetitionTime: number;
39export function run(moduleName: string, name: string, f: (arg0: TestCase) => void | Promise<any>, i: number, numberOfTests: number): Promise<boolean>;
40export function describe(description: string, info?: string): void;
41export function info(info: string): void;
42export const printDom: (_createNode: () => Node) => void;
43export const printCanvas: (canvas: HTMLCanvasElement, height: number) => void;
44export function group(description: string, f: (...args: any[]) => void): void;
45export function groupAsync(description: string, f: (...args: any[]) => Promise<any>): Promise<void>;
46export function measureTime(message: string, f: (...args: any[]) => void): number;
47export function measureTimeAsync(message: string, f: (...args: any[]) => Promise<any>): Promise<number>;
48export function compareArrays<T>(as: T[], bs: T[], m?: string | undefined): boolean;
49export function compareStrings(a: string, b: string, m?: string | undefined): void;
50export function compareObjects<K, V>(a: any, b: any, m?: string | undefined): void;
51export 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;
52export function assert<T>(property: T, message?: string | null | undefined): asserts property is NonNullable<T>;
53export function promiseRejected(f: (...args: any[]) => Promise<any>): Promise<void>;
54export function fails(f: (...args: any[]) => void): void;
55export function failsAsync(f: (...args: any[]) => Promise<any>): Promise<void>;
56export function runTests(tests: {
57 [x: string]: {
58 [x: string]: (arg0: TestCase) => void | Promise<any>;
59 };
60}): Promise<boolean>;
61export function fail(reason: string): never;
62export function skip(cond?: boolean): void;
63import * as prng from './prng.js';
64//# sourceMappingURL=testing.d.ts.map
\No newline at end of file