-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
79 lines (71 loc) · 2.2 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
declare module "@benchristel/taste" {
export function curry<Ret>(
f: () => Ret,
name?: string,
): () => Ret
export function curry<A1, Ret>(
f: (a1: A1) => Ret,
name?: string,
): (a1: A1) => Ret
export function curry<A1, A2, Ret>(
f: (a1: A1, a2: A2) => Ret,
name?: string,
): Curried2<A1, A2, Ret>
export function curry<A1, A2, A3, Ret>(
f: (a1: A1, a2: A2, a3: A3) => Ret,
name?: string,
): Curried3<A1, A2, A3, Ret>
export function equals(a: any, b: any): boolean
export function equals(a: any): (b: any) => boolean
export function is(a: any, b: any): boolean
export function is(a: any): (b: any) => boolean
export function test(
subject: string,
testDefinitions: {[title: string]: () => unknown},
): void
export function expect<A>(
actual: A,
matcher: (a: A) => unknown,
): void
export function expect<A, B>(
actual: A,
matcher: (b: B, a: A) => unknown,
expected: B,
): void
export function expect<A, B, C>(
actual: A,
matcher: (b: B, c: C, a: A) => unknown,
expected: B,
arg1: C,
): void
export function expect<A, B, C, D>(
actual: A,
matcher: (b: B, c: C, d: D, a: A) => unknown,
expected: B,
arg1: C,
arg2: D,
): void
export function not(predicate: Predicate): Predicate
export function which(predicate: Predicate): any
export function runTests(
a: TestList,
): Promise<{results: Array<TestResult>}>
export function getAllTests(): TestList
export function formatTestResultsAsText(results: any): string
export function createSuite(): {test: any; getAllTests: any}
export function debug(value: any): void
export function trimMargin(s: TemplateStringsArray | string): string
type Predicate = (...args: Array<any>) => any
type TestList = Array<Test>
type Test = {subject: string; scenario: string; fn: () => unknown}
type TestResult = {
error: Error | null
instrumentLog: Array<{type: string; [key: string]: any}>
test: Test
}
}
type Curried2<A1, A2, Ret> = ((a: A1) => (a: A2) => Ret) &
((a: A1, b: A2) => Ret)
type Curried3<A1, A2, A3, Ret> = ((a: A1, b: A2, c: A3) => Ret) &
((a: A1, b: A2) => (c: A3) => Ret) &
((a: A1) => Curried2<A2, A3, Ret>)