Skip to content

Commit e28bd6b

Browse files
committed
Update for_each_pair.test.ts
1 parent 85a9179 commit e28bd6b

File tree

1 file changed

+30
-35
lines changed

1 file changed

+30
-35
lines changed

src/array/for_each_pair.test.ts

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,38 @@ import forEachPair from "./for_each_pair.ts";
77

88
Deno.test(
99
'Call function for each pair.',
10-
async (test) => {
11-
await test.step({
12-
name: 'Empty array',
13-
fn: () => {
14-
function dummyFunction(
15-
previousValue : number,
16-
currentValue : number
17-
) : void {}
18-
19-
const dummyFunctionSpy = spy(dummyFunction);
10+
() => {
11+
function dummyFunction(
12+
previousValue : number,
13+
currentValue : number
14+
) : void {}
15+
16+
const dummyFunctionSpy = spy(dummyFunction);
2017

21-
forEachPair(
22-
[0, 2, 3, 7],
23-
dummyFunctionSpy
24-
)
18+
forEachPair(
19+
[0, 2, 3, 7],
20+
dummyFunctionSpy
21+
)
2522

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

0 commit comments

Comments
 (0)