Skip to content

Commit e640e7e

Browse files
test: improve perf more (#4640)
1 parent b2fc822 commit e640e7e

2 files changed

Lines changed: 1 addition & 61 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,6 @@ jobs:
7171
with:
7272
fetch-depth: 0
7373

74-
- name: Add workspace to Defender exclusions
75-
if: matrix.os == 'windows-latest'
76-
run: |
77-
Add-MpPreference -ExclusionPath "${{ github.workspace }}"
78-
79-
Add-MpPreference -ExclusionProcess "node.exe"
80-
81-
$npmCache = (npm config get cache)
82-
Add-MpPreference -ExclusionPath $npmCache
83-
84-
Set-MpPreference -DisableRealtimeMonitoring $true
85-
shell: powershell
86-
8774
- name: Using Node.js v${{ matrix.node-version }}
8875
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
8976
with:

test/create-webpack-app/init/init.test.js

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
const { existsSync, mkdirSync, readFileSync, writeFileSync } = require("node:fs");
2-
const { cp } = require("node:fs/promises");
1+
const { existsSync, mkdirSync, readFileSync } = require("node:fs");
32
const path = require("node:path");
43
const { join, resolve } = require("node:path");
54
const { createPathDependentUtils, isWindows, uniqueDirectoryForTest } = require("../test.utils");
@@ -63,56 +62,10 @@ const readFromPkgJSON = (path) => {
6362
const readFromWebpackConfig = (path) => readFileSync(join(path, "webpack.config.js"), "utf8");
6463

6564
describe("create-webpack-app cli", () => {
66-
let dirWithNodeModules;
67-
68-
beforeAll(async () => {
69-
dirWithNodeModules = await uniqueDirectoryForTest();
70-
71-
const { execa } = await import("execa");
72-
73-
writeFileSync(
74-
resolve(dirWithNodeModules, "package.json"),
75-
JSON.stringify({
76-
name: "test",
77-
description: "description",
78-
version: "1.0.0",
79-
dependencies: {
80-
"babel-loader": "latest",
81-
typescript: "latest",
82-
"html-loader": "latest",
83-
"html-webpack-plugin": "latest",
84-
postcss: "latest",
85-
"postcss-loader": "latest",
86-
autoprefixer: "latest",
87-
"sass-loader": "latest",
88-
"less-loader": "latest",
89-
"stylus-loader": "latest",
90-
"mini-css-extract-plugin": "latest",
91-
"style-loader": "latest",
92-
webpack: "latest",
93-
"webpack-cli": "latest",
94-
"webpack-dev-server": "latest",
95-
"workbox-webpack-plugin": "latest",
96-
},
97-
}),
98-
);
99-
100-
const { exitCode } = await execa("npm", ["install"], { cwd: dirWithNodeModules });
101-
102-
if (exitCode !== 0) {
103-
throw new Error("Problem with installation `node_modules` for caching");
104-
}
105-
});
106-
10765
let dir;
10866

10967
beforeEach(async () => {
11068
dir = await uniqueDirectoryForTest();
111-
112-
await cp(resolve(dirWithNodeModules, "./node_modules"), resolve(dir, "./node_modules"), {
113-
recursive: true,
114-
});
115-
await cp(resolve(dirWithNodeModules, "package-lock.json"), resolve(dir, "package-lock.json"));
11669
});
11770

11871
it("should generate default project when nothing is passed", async () => {

0 commit comments

Comments
 (0)