From b1545b7493f040f0ed1243f5aa0ea89da0aaa33a Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 6 Apr 2023 12:53:31 -0400 Subject: [PATCH] test: update module resolution E2E for latest framework changes The `module-resolution-core-mapping` E2E test modifies the tsconfig path mapping settings to change the location of `@angular/common`. However, with recent changes to the framework, the `@angular/platform-browser` package now also depends on `@angular/common/http` (a secondary export). This secondary export was not mapped in the test which resulted in the test failing since the build could not find the export. Related FW change: https://github.com/angular/angular/commit/81e7d15ef65b70c9734ebfd2c865e70d743263dc --- .../module-resolution-core-mapping.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/legacy-cli/e2e/tests/misc/module-resolution/module-resolution-core-mapping.ts b/tests/legacy-cli/e2e/tests/misc/module-resolution/module-resolution-core-mapping.ts index 2efae0ea5419..d2710b07b8be 100644 --- a/tests/legacy-cli/e2e/tests/misc/module-resolution/module-resolution-core-mapping.ts +++ b/tests/legacy-cli/e2e/tests/misc/module-resolution/module-resolution-core-mapping.ts @@ -12,12 +12,12 @@ export default async function () { await ng('build', '--configuration=development'); await createDir('xyz'); - await moveFile('node_modules/@angular/common', 'xyz/common'); + await moveFile('node_modules/@angular/platform-browser', 'xyz/platform-browser'); await expectToFail(() => ng('build', '--configuration=development')); await updateJsonFile('tsconfig.json', (tsconfig) => { tsconfig.compilerOptions.paths = { - '@angular/common': ['./xyz/common'], + '@angular/platform-browser': ['./xyz/platform-browser'], }; }); await ng('build', '--configuration=development'); @@ -25,17 +25,17 @@ export default async function () { await updateJsonFile('tsconfig.json', (tsconfig) => { tsconfig.compilerOptions.paths = { '*': ['./node_modules/*'], - '@angular/common': ['./xyz/common'], + '@angular/platform-browser': ['./xyz/platform-browser'], }; }); await ng('build', '--configuration=development'); await updateJsonFile('tsconfig.json', (tsconfig) => { tsconfig.compilerOptions.paths = { - '@angular/common': ['./xyz/common'], + '@angular/platform-browser': ['./xyz/platform-browser'], '*': ['./node_modules/*'], }; }); await ng('build', '--configuration=development'); - await moveFile('xyz/common', 'node_modules/@angular/common'); + await moveFile('xyz/platform-browser', 'node_modules/@angular/platform-browser'); }