Skip to content

Commit 88b4b35

Browse files
committed
Update for_each_pair.test.ts
1 parent 64147ef commit 88b4b35

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

src/array/for_each_pair.test.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,37 @@ Deno.test(
1313
name: 'Empty array',
1414
fn: () => {
1515
function dummyFunction(
16-
previousValue,
17-
currentValue
18-
) {}
16+
previousValue : number,
17+
currentValue : number
18+
) : void {}
19+
1920
const dummyFunctionSpy = spy(dummyFunction);
2021

21-
22+
forEachPair(
23+
[0, 2, 3, 7],
24+
dummyFunctionSpy
25+
)
26+
27+
assertSpyCall(dummyFunctionSpy, 0, {
28+
args: [
29+
0,
30+
2
31+
]
32+
})
33+
assertSpyCall(dummyFunctionSpy, 1, {
34+
args: [
35+
2,
36+
3
37+
]
38+
})
39+
assertSpyCall(dummyFunctionSpy, 2, {
40+
args: [
41+
3,
42+
7
43+
]
44+
})
45+
46+
assertSpyCalls(dummyFunctionSpy, 3);
2247
}
2348
})
2449
}

0 commit comments

Comments
 (0)