File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
tests/legacy-cli/e2e/tests/misc Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11import { rimraf } from '../../utils/fs' ;
22import { getActivePackageManager } from '../../utils/packages' ;
3- import { ng , npm } from '../../utils/process' ;
3+ import { execWithEnv , ng , npm } from '../../utils/process' ;
44import { isPrereleaseCli } from '../../utils/project' ;
55import { expectToFail } from '../../utils/utils' ;
66
@@ -38,10 +38,12 @@ export default async function () {
3838 await npm ( 'install' , '--global' , 'npm@7.4.0' ) ;
3939
4040 // Ensure `ng add` shows npm warning
41- // The below command will fail with the below due to incorrect peerDeps
42- const { message : stderrAdd } = await expectToFail ( ( ) =>
43- ng ( 'add' , '@angular/localize' , '--skip-confirmation' ) ,
41+ const { stderr : stderrAdd } = await execWithEnv (
42+ 'ng' ,
43+ [ 'add' , '@angular/localize' , '--skip-confirmation' ] ,
44+ { ...process . env , 'NPM_CONFIG_legacy_peer_deps' : 'true' } ,
4445 ) ;
46+
4547 if ( ! stderrAdd . includes ( warningText ) ) {
4648 throw new Error ( 'ng add expected to show npm version warning.' ) ;
4749 }
You can’t perform that action at this time.
0 commit comments