|
1 |
| -import { execWithEnv, killAllProcesses, waitForAnyProcessOutputToMatch } from '../../utils/process'; |
| 1 | +import { execAndWaitForOutputToMatch, killAllProcesses } from '../../utils/process'; |
2 | 2 |
|
3 | 3 | export default async function () {
|
4 | 4 | try {
|
5 |
| - // Execute a command with TTY force enabled |
6 |
| - execWithEnv('ng', ['deploy'], { |
7 |
| - ...process.env, |
8 |
| - NG_FORCE_TTY: '1', |
9 |
| - NG_CLI_ANALYTICS: 'false', |
10 |
| - }); |
11 |
| - |
12 |
| - // Check if the prompt is shown |
13 |
| - await waitForAnyProcessOutputToMatch( |
| 5 | + // Execute a command with TTY force enabled and check that the prompt is shown. |
| 6 | + await execAndWaitForOutputToMatch( |
| 7 | + 'ng', |
| 8 | + ['deploy'], |
14 | 9 | /Would you like to add a package with "deploy" capabilities/,
|
| 10 | + { |
| 11 | + ...process.env, |
| 12 | + NG_FORCE_TTY: '1', |
| 13 | + NG_CLI_ANALYTICS: 'false', |
| 14 | + }, |
15 | 15 | );
|
16 | 16 |
|
17 | 17 | await killAllProcesses();
|
18 | 18 |
|
19 |
| - // Execute a command with TTY force enabled |
20 |
| - execWithEnv('ng', ['lint'], { |
| 19 | + // Execute a command with TTY force enabled and check that the prompt is shown. |
| 20 | + await execAndWaitForOutputToMatch('ng', ['lint'], /Would you like to add ESLint now/, { |
21 | 21 | ...process.env,
|
22 | 22 | NG_FORCE_TTY: '1',
|
23 | 23 | NG_CLI_ANALYTICS: 'false',
|
24 | 24 | });
|
25 |
| - |
26 |
| - // Check if the prompt is shown |
27 |
| - await waitForAnyProcessOutputToMatch(/Would you like to add ESLint now/); |
28 | 25 | } finally {
|
29 | 26 | await killAllProcesses();
|
30 | 27 | }
|
|
0 commit comments