From 118ffb17feb76457f7f5417230ebac5af88bb5e6 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Wed, 31 Mar 2021 12:25:56 -0400 Subject: [PATCH] test(@ngtools/webpack): update webpack test-app E2E to use Webpack 5 The direct Webpack test for the Webpack plugin is now updated to use Webpack 5 as Webpack 5 is now the default for the Angular tooling. --- .../legacy-cli/e2e/assets/webpack/test-app/package.json | 4 ++-- tests/legacy-cli/e2e/tests/packages/webpack/test-app.ts | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/legacy-cli/e2e/assets/webpack/test-app/package.json b/tests/legacy-cli/e2e/assets/webpack/test-app/package.json index c7a2c7d673a9..95f91bb566d9 100644 --- a/tests/legacy-cli/e2e/assets/webpack/test-app/package.json +++ b/tests/legacy-cli/e2e/assets/webpack/test-app/package.json @@ -18,9 +18,9 @@ "devDependencies": { "raw-loader": "^4.0.2", "sass": "^1.32.8", - "sass-loader": "^10.1.1", + "sass-loader": "^11.0.1", "typescript": "~4.2.3", - "webpack": "^4.46.0", + "webpack": "^5.27.0", "webpack-cli": "^4.5.0" } } diff --git a/tests/legacy-cli/e2e/tests/packages/webpack/test-app.ts b/tests/legacy-cli/e2e/tests/packages/webpack/test-app.ts index dfc0f7545429..1ee5f70b03ed 100644 --- a/tests/legacy-cli/e2e/tests/packages/webpack/test-app.ts +++ b/tests/legacy-cli/e2e/tests/packages/webpack/test-app.ts @@ -3,17 +3,18 @@ import { createProjectFromAsset } from '../../../utils/assets'; import { expectFileSizeToBeUnder, expectFileToMatch, replaceInFile } from '../../../utils/fs'; import { exec } from '../../../utils/process'; - export default async function (skipCleaning: () => void) { const webpackCLIBin = normalize('node_modules/.bin/webpack-cli'); await createProjectFromAsset('webpack/test-app'); + await exec(webpackCLIBin); // Note: these sizes are without Build Optimizer or any advanced optimizations in the CLI. - await expectFileSizeToBeUnder('dist/app.main.js', 565 * 1024); - await expectFileSizeToBeUnder('dist/1.app.main.js', 1 * 1024); - await expectFileSizeToBeUnder('dist/2.app.main.js', 2 * 1024); + await expectFileSizeToBeUnder('dist/app.main.js', 656 * 1024); + await expectFileSizeToBeUnder('dist/501.app.main.js', 1 * 1024); + await expectFileSizeToBeUnder('dist/888.app.main.js', 2 * 1024); + await expectFileSizeToBeUnder('dist/972.app.main.js', 2 * 1024); // test resource urls without ./