File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -5,20 +5,21 @@ const { once } = require('node:events');
55const { test } = require ( 'node:test' ) ;
66const { setImmediate } = require ( 'node:timers/promises' ) ;
77
8- test ( 'should resolve `once` twice' , ( t , done ) => {
8+ test ( 'should resolve `once` twice' , async ( ) => {
99
1010 const et = new EventTarget ( ) ;
1111
12- ( async ( ) => {
13- await once ( et , 'foo' ) ;
14- await once ( et , 'foo' ) ;
15- done ( ) ;
16- } ) ( common . mustCall ( ) ) ;
12+ await Promise . all ( [
13+ ( async ( ) => {
14+ await once ( et , 'foo' ) ;
15+ await once ( et , 'foo' ) ;
16+ } ) ( ) ,
1717
18- ( async ( ) => {
19- et . dispatchEvent ( new Event ( 'foo' ) ) ;
20- await setImmediate ( ) ;
21- et . dispatchEvent ( new Event ( 'foo' ) ) ;
22- } ) ( common . mustCall ( ) ) ;
18+ ( async ( ) => {
19+ et . dispatchEvent ( new Event ( 'foo' ) ) ;
20+ await setImmediate ( ) ;
21+ et . dispatchEvent ( new Event ( 'foo' ) ) ;
22+ } ) ( )
23+ ] ) ;
2324
2425} ) ;
You can’t perform that action at this time.
0 commit comments