1
1
import { join } from 'path' ;
2
2
import { getGlobalVariable } from '../utils/env' ;
3
- import { expectFileToExist } from '../utils/fs' ;
3
+ import { expectFileToExist , writeFile } from '../utils/fs' ;
4
4
import { 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' ;
7
7
import { prepareProjectForE2e , updateJsonFile } from '../utils/project' ;
8
8
9
9
export default async function ( ) {
@@ -18,6 +18,8 @@ export default async function () {
18
18
await gitClean ( ) ;
19
19
} else {
20
20
const extraArgs = [ ] ;
21
+ const testRegistry = getGlobalVariable ( 'package-registry' ) ;
22
+ const isCI = getGlobalVariable ( 'ci' ) ;
21
23
22
24
// Ensure local test registry is used when outside a project
23
25
await setNPMConfigRegistry ( true ) ;
@@ -26,7 +28,11 @@ export default async function () {
26
28
await expectFileToExist ( join ( process . cwd ( ) , 'test-project' ) ) ;
27
29
process . chdir ( './test-project' ) ;
28
30
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
+ }
30
36
31
37
// Setup esbuild builder if requested on the commandline
32
38
const useEsbuildBuilder = ! ! getGlobalVariable ( 'argv' ) [ 'esbuild' ] ;
0 commit comments