From 645ce9ff2802e407e41930ebd35b6f317ede6fd6 Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 28 Jan 2026 13:58:37 +0300 Subject: [PATCH 1/2] test: improve perf more --- .github/workflows/nodejs.yml | 24 ++++++------ test/create-webpack-app/init/init.test.js | 46 ----------------------- 2 files changed, 12 insertions(+), 58 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 3763a7467cb..a3bb649f7e9 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -71,18 +71,18 @@ jobs: with: fetch-depth: 0 - - name: Add workspace to Defender exclusions - if: matrix.os == 'windows-latest' - run: | - Add-MpPreference -ExclusionPath "${{ github.workspace }}" - - Add-MpPreference -ExclusionProcess "node.exe" - - $npmCache = (npm config get cache) - Add-MpPreference -ExclusionPath $npmCache - - Set-MpPreference -DisableRealtimeMonitoring $true - shell: powershell + # - name: Add workspace to Defender exclusions + # if: matrix.os == 'windows-latest' + # run: | + # Add-MpPreference -ExclusionPath "${{ github.workspace }}" + # + # Add-MpPreference -ExclusionProcess "node.exe" + # + # $npmCache = (npm config get cache) + # Add-MpPreference -ExclusionPath $npmCache + # + # Set-MpPreference -DisableRealtimeMonitoring $true + # shell: powershell - name: Using Node.js v${{ matrix.node-version }} uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 diff --git a/test/create-webpack-app/init/init.test.js b/test/create-webpack-app/init/init.test.js index d9bf1072d67..1e65f740a1d 100644 --- a/test/create-webpack-app/init/init.test.js +++ b/test/create-webpack-app/init/init.test.js @@ -63,56 +63,10 @@ const readFromPkgJSON = (path) => { const readFromWebpackConfig = (path) => readFileSync(join(path, "webpack.config.js"), "utf8"); describe("create-webpack-app cli", () => { - let dirWithNodeModules; - - beforeAll(async () => { - dirWithNodeModules = await uniqueDirectoryForTest(); - - const { execa } = await import("execa"); - - writeFileSync( - resolve(dirWithNodeModules, "package.json"), - JSON.stringify({ - name: "test", - description: "description", - version: "1.0.0", - dependencies: { - "babel-loader": "latest", - typescript: "latest", - "html-loader": "latest", - "html-webpack-plugin": "latest", - postcss: "latest", - "postcss-loader": "latest", - autoprefixer: "latest", - "sass-loader": "latest", - "less-loader": "latest", - "stylus-loader": "latest", - "mini-css-extract-plugin": "latest", - "style-loader": "latest", - webpack: "latest", - "webpack-cli": "latest", - "webpack-dev-server": "latest", - "workbox-webpack-plugin": "latest", - }, - }), - ); - - const { exitCode } = await execa("npm", ["install"], { cwd: dirWithNodeModules }); - - if (exitCode !== 0) { - throw new Error("Problem with installation `node_modules` for caching"); - } - }); - let dir; beforeEach(async () => { dir = await uniqueDirectoryForTest(); - - await cp(resolve(dirWithNodeModules, "./node_modules"), resolve(dir, "./node_modules"), { - recursive: true, - }); - await cp(resolve(dirWithNodeModules, "package-lock.json"), resolve(dir, "package-lock.json")); }); it("should generate default project when nothing is passed", async () => { From f8d0583d1bf187d8ca84075b79010baae1b19f03 Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Wed, 28 Jan 2026 14:16:04 +0300 Subject: [PATCH 2/2] refactor: fix lint --- .github/workflows/nodejs.yml | 13 ------------- test/create-webpack-app/init/init.test.js | 3 +-- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index a3bb649f7e9..482976de74a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -71,19 +71,6 @@ jobs: with: fetch-depth: 0 - # - name: Add workspace to Defender exclusions - # if: matrix.os == 'windows-latest' - # run: | - # Add-MpPreference -ExclusionPath "${{ github.workspace }}" - # - # Add-MpPreference -ExclusionProcess "node.exe" - # - # $npmCache = (npm config get cache) - # Add-MpPreference -ExclusionPath $npmCache - # - # Set-MpPreference -DisableRealtimeMonitoring $true - # shell: powershell - - name: Using Node.js v${{ matrix.node-version }} uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: diff --git a/test/create-webpack-app/init/init.test.js b/test/create-webpack-app/init/init.test.js index 1e65f740a1d..54794e546b6 100644 --- a/test/create-webpack-app/init/init.test.js +++ b/test/create-webpack-app/init/init.test.js @@ -1,5 +1,4 @@ -const { existsSync, mkdirSync, readFileSync, writeFileSync } = require("node:fs"); -const { cp } = require("node:fs/promises"); +const { existsSync, mkdirSync, readFileSync } = require("node:fs"); const path = require("node:path"); const { join, resolve } = require("node:path"); const { createPathDependentUtils, isWindows, uniqueDirectoryForTest } = require("../test.utils");