UNPKG
flush-promises
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
Flush promises in tests
github.com/kentor/flush-promises
kentor/flush-promises
flush-promises
/
test.js
20 lines
(14 loc)
•
258 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use strict'
;
const
flushPromises =
require
(
'.'
);
test
(
'flushPromises'
,
async
() => {
let
a;
let
b;
Promise
.
resolve
().
then
(
() =>
{ a =
1
; }).
then
(
() =>
{ b =
2
; })
await
flushPromises
();
expect
(a).
toBe
(
1
);
expect
(b).
toBe
(
2
); });