File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
tests/legacy-cli/e2e/tests/misc Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ import { createDir , rimraf } from '../../utils/fs' ;
2+ import {
3+ execWithEnv ,
4+ killAllProcesses ,
5+ waitForAnyProcessOutputToMatch ,
6+ } from '../../utils/process' ;
7+
8+ const packages = require ( '../../../../../lib/packages' ) . packages ;
9+
10+ export default async function ( ) {
11+ // Create a temporary directory to install the CLI
12+ await createDir ( '../ask-analytics' ) ;
13+ const cwd = process . cwd ( ) ;
14+ process . chdir ( '../ask-analytics' ) ;
15+
16+ try {
17+ // Install the CLI with TTY force enabled
18+ const execution = execWithEnv (
19+ 'npm' ,
20+ [ 'install' , packages [ '@angular/cli' ] . tar ] ,
21+ { ...process . env , 'NG_FORCE_TTY' : '1' } ,
22+ ) ;
23+
24+ // Check if the prompt is shown
25+ await waitForAnyProcessOutputToMatch ( / W o u l d y o u l i k e t o s h a r e a n o n y m o u s u s a g e d a t a / ) ;
26+
27+ } finally {
28+ killAllProcesses ( ) ;
29+
30+ // Cleanup
31+ process . chdir ( cwd ) ;
32+ await rimraf ( '../ask-analytics' ) ;
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments