UNPKG
@shanyue/promise-utils
Version:
latest (2.0.4)
2.0.4
2.0.3
2.0.2
Userful promise utils, include map, filter, retry and sleep
@shanyue/promise-utils
/
test
/
sleep.ts
15 lines
(10 loc)
•
279 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import
{ describe, it }
from
'mocha'
import
{ expect }
from
'chai'
import
{ sleep }
from
'../index'
describe
(
'Promise.sleep'
,
function
(
) {
it
(
'expect work'
,
async
() => {
const
start =
Date
.
now
()
await
sleep
(
800
)
expect
(
Date
.
now
()).
to
.
gte
(start +
800
) }) })