Skip to content

Commit

Permalink
test: update module resolution E2E for latest framework changes
Browse files Browse the repository at this point in the history
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: angular/angular@81e7d15

(cherry picked from commit e66698a)
  • Loading branch information
clydin authored and dgp1130 committed Apr 6, 2023
1 parent 1922147 commit 54e4acb
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ 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');

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');
}

0 comments on commit 54e4acb

Please sign in to comment.