diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 3763a7467cb..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 d9bf1072d67..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"); @@ -63,56 +62,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 () => {