Skip to content

Commit f41341f

Browse files
committed
wip: always use env vars instead of npmrc
1 parent d29004e commit f41341f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

tests/legacy-cli/e2e/utils/packages.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getGlobalVariable } from './env';
2-
import { ProcessOutput, npm, silentNpm, silentYarn } from './process';
2+
import { ProcessOutput, silentNpm, silentYarn } from './process';
33

44
export function getActivePackageManager(): 'npm' | 'yarn' {
55
const value = getGlobalVariable('package-manager');
@@ -49,17 +49,11 @@ export async function setRegistry(useTestRegistry: boolean): Promise<void> {
4949
? getGlobalVariable('package-registry')
5050
: 'https://registry.npmjs.org';
5151

52-
const isCI = getGlobalVariable('ci');
5352
const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots'];
5453

5554
// Ensure local test registry is used when outside a project
56-
if (isCI) {
57-
// Safe to set a user configuration on CI
58-
await npm('config', 'set', 'registry', url);
59-
} else {
60-
// Yarn supports both `NPM_CONFIG_REGISTRY` and `YARN_REGISTRY`.
61-
process.env['NPM_CONFIG_REGISTRY'] = url;
62-
}
55+
// Yarn supports both `NPM_CONFIG_REGISTRY` and `YARN_REGISTRY`.
56+
process.env['NPM_CONFIG_REGISTRY'] = url;
6357

6458
// Snapshot builds may contain versions that are not yet released (e.g., RC phase main branch).
6559
// In this case peer dependency ranges may not resolve causing npm 7+ to fail during tests.

0 commit comments

Comments
 (0)