Skip to content

Commit 00b3763

Browse files
committed
chore: fix tests
1 parent 76f1826 commit 00b3763

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

test/helpers/normalizeErrors.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
function removeCWD(str) {
22
const isWin = process.platform === "win32";
33
let cwd = process.cwd();
4+
let normalizedStr = str;
45

56
if (isWin) {
6-
// eslint-disable-next-line no-param-reassign
7-
str = str.replace(/\\/g, "/");
8-
// eslint-disable-next-line no-param-reassign
7+
normalizedStr = normalizedStr.replace(/\\/g, "/");
98
cwd = cwd.replace(/\\/g, "/");
109
}
1110

12-
return str.replace(new RegExp(cwd, "g"), "");
11+
// Normalize file URLs to always use 'file:///'
12+
normalizedStr = normalizedStr.replace(/file:\/*/g, "file:///");
13+
14+
return normalizedStr.replace(new RegExp(cwd, "g"), "");
1315
}
1416

1517
export default (errors) =>

test/parallel-option.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jest.mock("os", () => {
1818
typeof actualOs.availableParallelism !== "undefined";
1919

2020
const mocked = {
21+
// eslint-disable-next-line no-undefined
2122
availableParallelism: isAvailableParallelism ? jest.fn(() => 4) : undefined,
2223
cpus: jest.fn(() => {
2324
return { length: 4 };
@@ -132,6 +133,7 @@ describe("parallel option", () => {
132133
});
133134

134135
it('should match snapshot for the "undefined" value', async () => {
136+
// eslint-disable-next-line no-undefined
135137
new CssMinimizerPlugin({ parallel: undefined }).apply(compiler);
136138

137139
const stats = await compile(compiler);

0 commit comments

Comments
 (0)