We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73f6018 commit 5977086Copy full SHA for 5977086
test/util.ts
@@ -1,11 +1,11 @@
1
-export function times(count: number, fn: () => void) {
+export function times(count: number, done: (err?: Error) => void) {
2
let i = 0;
3
return () => {
4
i++;
5
if (i === count) {
6
- fn();
+ done();
7
} else if (i > count) {
8
- throw new Error(`too many calls: ${i} instead of ${count}`);
+ done(new Error(`too many calls: ${i} instead of ${count}`));
9
}
10
};
11
@@ -14,6 +14,6 @@ export function sleep(duration: number) {
14
return new Promise((resolve) => setTimeout(resolve, duration));
15
16
17
-export function shouldNotHappen(done) {
+export function shouldNotHappen(done: (err?: Error) => void) {
18
return () => done(new Error("should not happen"));
19
0 commit comments