forked from kevin940726/console-testing-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
45 lines (36 loc) · 909 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
export const originalConsole = Console;
type Options = {
isSilent?: boolean;
};
export enum ConsoleLevels {
log,
info,
warn,
error,
}
export type TestingConsole = Console;
export type TestingConsoleInstance = {
log: string;
logs: [ConsoleLevels, string][];
levels: {
log: string;
info: string;
warn: string;
error: string;
};
getRecord: (method: string) => string;
silence: boolean;
private _targetConsole: TestingConsole | Console;
};
export function createConsole(options?: Options): TestingConsole;
export function mockConsole(
testingConsole: TestingConsole,
targetConsoleParent?: {} = global,
targetConsoleKey?: string
): () => void;
export function getLog(testingConsole?: TestingConsole): TestingConsoleInstance;
export function silenceConsole(
testingConsole?: TestingConsole,
shouldSilent?: boolean
): void;
export function restore(): void;