Skip to content

Commit 2c25333

Browse files
committed
test(@angular/cli): remove unscoped authentication test cases from registry tests
Modern package managers do not support unscoped authentication, and Yarn Classic's metadata command (yarn info) does not propagate unscoped credentials correctly, leading to 403 Forbidden failures on secure registries during ng update and ng add. This commit removes the unscoped authentication test cases from both add and update secure registry E2E tests, and cleans up the createNpmConfigForAuthentication helper to default to scoped authentication.
1 parent 4488398 commit 2c25333

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

tests/e2e/tests/update/update-secure-registry.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import { getActivePackageManager } from '../../utils/packages';
66
import assert from 'node:assert';
77

88
export default async function () {
9-
const packageManager = getActivePackageManager();
10-
const supportsUnscopedAuth = packageManager === 'yarn';
11-
129
// The environment variable has priority over the .npmrc
1310
delete process.env['NPM_CONFIG_REGISTRY'];
1411
const worksMessage = 'We analyzed your package.json';
@@ -20,14 +17,6 @@ export default async function () {
2017

2118
// Valid authentication token
2219

23-
if (supportsUnscopedAuth) {
24-
await createNpmConfigForAuthentication(false);
25-
const { stdout: stdout1 } = await ng('update', ...extraArgs);
26-
if (!stdout1.includes(worksMessage)) {
27-
throw new Error(`Expected stdout to contain "${worksMessage}"`);
28-
}
29-
}
30-
3120
await createNpmConfigForAuthentication(true);
3221
const { stdout: stdout2 } = await ng('update', ...extraArgs);
3322
if (!stdout2.includes(worksMessage)) {
@@ -36,11 +25,6 @@ export default async function () {
3625

3726
// Invalid authentication token
3827

39-
if (supportsUnscopedAuth) {
40-
await createNpmConfigForAuthentication(false, true);
41-
await expectToFail(() => ng('update', ...extraArgs));
42-
}
43-
4428
await createNpmConfigForAuthentication(true, true);
4529
await expectToFail(() => ng('update', ...extraArgs));
4630

0 commit comments

Comments
 (0)