We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a318aa4 commit 5b427f1Copy full SHA for 5b427f1
test/subCommands.test.ts
@@ -1,6 +1,7 @@
1
import { expect, test } from 'vitest';
2
import { runp } from '../src';
3
-import { TestTerminal } from './_helpers';
+import { poll, TestTerminal } from './_helpers';
4
+import { setTimeout } from 'timers/promises';
5
6
test('subCommands', async () => {
7
const term = new TestTerminal({ cols: 30, rows: 20 });
@@ -27,7 +28,9 @@ test('subCommands', async () => {
27
28
linearOutput: true,
29
});
30
- expect(term.getBuffer()).toMatchInlineSnapshot(`
31
+ await poll(
32
+ () =>
33
+ expect(term.getBuffer()).toMatchInlineSnapshot(`
34
[
35
" ",
36
"-- [subCommand 1] -> ",
@@ -50,5 +53,7 @@ test('subCommands', async () => {
50
53
51
54
52
55
]
- `);
56
+ `),
57
+ 1000,
58
+ );
59
0 commit comments