File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ export async function runp<const TCommands extends Commands = Commands>(
112112 const results = await Promise . all ( tasks . map ( ( task ) => task . result ) ) ;
113113 await new Promise < void > ( ( resolve ) => setTimeout ( resolve ) ) ;
114114 stop ?.( ) ;
115+ await new Promise < void > ( ( resolve ) => setTimeout ( resolve ) ) ;
115116 return results as { [ K in keyof TCommands ] : RunpResult } ;
116117}
117118
Original file line number Diff line number Diff line change 1- import { expect , test } from 'vitest' ;
1+ import { test } from 'vitest' ;
22import { runp } from '../src' ;
3- import { poll , TestTerminal } from './_helpers' ;
4- import { setTimeout } from 'timers/promises' ;
3+ import { TestTerminal } from './_helpers' ;
54
6- test ( 'subCommands' , async ( ) => {
5+ test ( 'subCommands' , async ( { expect } ) => {
76 const term = new TestTerminal ( { cols : 30 , rows : 20 } ) ;
87
98 await runp ( {
@@ -28,9 +27,7 @@ test('subCommands', async () => {
2827 linearOutput : true ,
2928 } ) ;
3029
31- await poll (
32- ( ) =>
33- expect ( term . getBuffer ( ) ) . toMatchInlineSnapshot ( `
30+ expect ( term . getBuffer ( ) ) . toMatchInlineSnapshot ( `
3431 [
3532 " ",
3633 "-- [subCommand 1] -> ",
@@ -53,7 +50,5 @@ test('subCommands', async () => {
5350 " ",
5451 " ",
5552 ]
56- ` ) ,
57- 1000 ,
58- ) ;
53+ ` ) ;
5954} ) ;
You can’t perform that action at this time.
0 commit comments