-
Notifications
You must be signed in to change notification settings - Fork 3
/
assert.d.ts
68 lines (55 loc) · 1.72 KB
/
assert.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
export type AssertPredicate =
| RegExp
| (new () => object)
| ((thrown: unknown) => boolean)
| {
readonly name?: string | RegExp
readonly message?: string | RegExp
readonly [k: string]: unknown
}
| Error
export interface StrictAssertModule {
fail(message?: string | Error): never
ok(value: unknown, message?: string | Error): void
equal<T>(actual: unknown, expected: T, message?: string | Error): void
notEqual(actual: unknown, expected: unknown, message?: string | Error): void
deepEqual<T>(actual: unknown, expected: T, message?: string | Error): void
notDeepEqual(
actual: unknown,
expected: unknown,
message?: string | Error
): void
throws(block: () => unknown, message?: string | Error): void
throws(
block: () => unknown,
error: AssertPredicate,
message?: string | Error
): void
doesNotThrow(block: () => unknown, message?: string | Error): void
doesNotThrow(
block: () => unknown,
error: AssertPredicate,
message?: string | Error
): void
ifError(value: unknown): void
rejects(
block: (() => Promise<unknown>) | Promise<unknown>,
message?: string | Error
): Promise<void>
rejects(
block: (() => Promise<unknown>) | Promise<unknown>,
error: AssertPredicate,
message?: string | Error
): Promise<void>
doesNotReject(
block: (() => Promise<unknown>) | Promise<unknown>,
message?: string | Error
): Promise<void>
doesNotReject(
block: (() => Promise<unknown>) | Promise<unknown>,
error: AssertPredicate,
message?: string | Error
): Promise<void>
match(value: string, regExp: RegExp, message?: string | Error): void
doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void
}