Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ 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:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ packages/**/yarn.lock

# test output files
test/js/*
test/create-webpack-app-testing/*
test/**/bin/
test/**/**/bin/
test/**/**/**/bin/
Expand Down
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import configs from "eslint-config-webpack/configs.js";
export default defineConfig([
globalIgnores([
"packages/*/lib/**/*",
"test/**/create-webpack-app-testing/**/*",
"test/**/dist/**/*",
"test/**/bin/**/*",
"test/**/binary/**/*",
Expand Down
7 changes: 5 additions & 2 deletions test/create-webpack-app/init/init.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { existsSync, mkdirSync, readFileSync, writeFileSync } = require("node:fs");
const { cp } = require("node:fs/promises");
const os = require("node:os");
const path = require("node:path");
const { join, resolve } = require("node:path");
const { createPathDependentUtils, isWindows, uniqueDirectoryForTest } = require("../test.utils");
Expand Down Expand Up @@ -149,7 +148,11 @@ describe("create-webpack-app cli", () => {
});

it("should generate folders if non existing generation path is given", async () => {
const assetsPath = path.resolve(os.tmpdir(), Date.now().toString());
const assetsPath = path.resolve(
__dirname,
"../create-webpack-app-testing",
Date.now().toString(),
);
const { stdout } = await run(__dirname, ["init", assetsPath, "--force"]);

expect(stdout).toContain("Project has been initialised with webpack!");
Expand Down
5 changes: 2 additions & 3 deletions test/utils/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const { exec } = require("node:child_process");
const fs = require("node:fs");
const os = require("node:os");
const path = require("node:path");
const { stripVTControlCharacters } = require("node:util");
const concat = require("concat-stream");
Expand Down Expand Up @@ -373,10 +372,10 @@ const uuid = (size = 21) => {
};

const uniqueDirectoryForTest = async () => {
const result = path.resolve(os.tmpdir(), uuid());
const result = path.resolve(path.resolve(__dirname, "../create-webpack-app-testing"), uuid());

if (!fs.existsSync(result)) {
fs.mkdirSync(result);
fs.mkdirSync(result, { recursive: true });
}

return result;
Expand Down