UNPKG
es7-sleep
Version:
latest (1.0.0)
1.0.0
ES7 sleep function with async/await
github.com/Secbone/es7-sleep
Secbone/es7-sleep
es7-sleep
/
test
/
test.js
12 lines
(9 loc)
•
261 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
sleep
from
"../index.js"
;
describe
(
"es7-sleep"
,
() =>
{
it
(
"should delay 1000ms"
,
async
() => {
let
start =
new
Date
();
await
sleep
(
1000
);
let
end =
new
Date
();
return
(end-start) >
1000
; }); });