Skip to content

Commit 5977086

Browse files
refactor: use typescript strict setting (bis)
1 parent 73f6018 commit 5977086

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/util.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
export function times(count: number, fn: () => void) {
1+
export function times(count: number, done: (err?: Error) => void) {
22
let i = 0;
33
return () => {
44
i++;
55
if (i === count) {
6-
fn();
6+
done();
77
} else if (i > count) {
8-
throw new Error(`too many calls: ${i} instead of ${count}`);
8+
done(new Error(`too many calls: ${i} instead of ${count}`));
99
}
1010
};
1111
}
@@ -14,6 +14,6 @@ export function sleep(duration: number) {
1414
return new Promise((resolve) => setTimeout(resolve, duration));
1515
}
1616

17-
export function shouldNotHappen(done) {
17+
export function shouldNotHappen(done: (err?: Error) => void) {
1818
return () => done(new Error("should not happen"));
1919
}

0 commit comments

Comments
 (0)