11import { join } from 'path' ;
22import { getGlobalVariable } from '../utils/env' ;
3- import { expectFileToExist } from '../utils/fs' ;
3+ import { expectFileToExist , writeFile } from '../utils/fs' ;
44import { gitClean } from '../utils/git' ;
5- import { setRegistry as setNPMConfigRegistry , setRegistry } from '../utils/packages' ;
6- import { ng } from '../utils/process' ;
5+ import { setRegistry as setNPMConfigRegistry } from '../utils/packages' ;
6+ import { ng , npm } from '../utils/process' ;
77import { prepareProjectForE2e , updateJsonFile } from '../utils/project' ;
88
99export default async function ( ) {
@@ -18,6 +18,8 @@ export default async function () {
1818 await gitClean ( ) ;
1919 } else {
2020 const extraArgs = [ ] ;
21+ const testRegistry = getGlobalVariable ( 'package-registry' ) ;
22+ const isCI = getGlobalVariable ( 'ci' ) ;
2123
2224 // Ensure local test registry is used when outside a project
2325 await setNPMConfigRegistry ( true ) ;
@@ -26,7 +28,11 @@ export default async function () {
2628 await expectFileToExist ( join ( process . cwd ( ) , 'test-project' ) ) ;
2729 process . chdir ( './test-project' ) ;
2830
29- setRegistry ( true ) ;
31+ // If on CI, the user configuration set above will handle project usage
32+ if ( ! isCI ) {
33+ // Ensure local test registry is used inside a project
34+ await writeFile ( '.npmrc' , `registry=${ testRegistry } ` ) ;
35+ }
3036
3137 // Setup esbuild builder if requested on the commandline
3238 const useEsbuildBuilder = ! ! getGlobalVariable ( 'argv' ) [ 'esbuild' ] ;
0 commit comments