Skip to content

Commit cfc228c

Browse files
kyliaualan-agius4
authored andcommitted
test(@schematics/schematics): run npm install from local registry
After a new tag is pushed, the schematic e2e test will attempt to install the latest version, but it incorrectly installs the version from the actual NPM registry instead of the local registry.
1 parent 9970beb commit cfc228c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/legacy-cli/e2e/tests/schematics_cli/blank-test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as fs from 'fs';
12
import * as path from 'path';
23
import { getGlobalVariable } from '../../utils/env';
34
import { exec, silentNpm } from '../../utils/process';
@@ -10,11 +11,12 @@ export default async function () {
1011
return;
1112
}
1213

14+
fs.writeFileSync('.npmrc', 'registry = http://localhost:4873', 'utf8');
15+
1316
await silentNpm(
1417
'install',
1518
'-g',
1619
'@angular-devkit/schematics-cli',
17-
'--registry=http://localhost:4873',
1820
);
1921
await exec(process.platform.startsWith('win') ? 'where' : 'which', 'schematics');
2022

tests/legacy-cli/e2e/tests/schematics_cli/schematic-test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as fs from 'fs';
12
import * as path from 'path';
23
import { getGlobalVariable } from '../../utils/env';
34
import { exec, silentNpm } from '../../utils/process';
@@ -10,11 +11,12 @@ export default async function () {
1011
return;
1112
}
1213

14+
fs.writeFileSync('.npmrc', 'registry = http://localhost:4873', 'utf8');
15+
1316
await silentNpm(
1417
'install',
1518
'-g',
1619
'@angular-devkit/schematics-cli',
17-
'--registry=http://localhost:4873',
1820
);
1921
await exec(process.platform.startsWith('win') ? 'where' : 'which', 'schematics');
2022

0 commit comments

Comments
 (0)