Skip to content

Commit 4ef9f84

Browse files
committed
Added testUtils.sleep
1 parent 2c6a15d commit 4ef9f84

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ function bytes2BigInt(bytes: Uint8Array): bigint {
117117
return BigInt('0x' + hex);
118118
}
119119

120+
async function sleep(ms: number) {
121+
return await new Promise((r) => setTimeout(r, ms));
122+
}
123+
120124
export {
121125
getRandomInt,
122126
getRandomBytes,
@@ -128,4 +132,5 @@ export {
128132
dec2Hex,
129133
bytes2Hex,
130134
bytes2BigInt,
135+
sleep,
131136
};

0 commit comments

Comments
 (0)