From e144fd2bb885a17b04b5e9bc58969555fea99f10 Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Mon, 4 Aug 2025 19:09:25 +0300 Subject: [PATCH 1/4] ci: add Node.js 24 --- .github/workflows/nodejs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 284627cc..69c8b134 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -67,7 +67,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x] + node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x, 24.x] webpack-version: [latest] runs-on: ${{ matrix.os }} @@ -127,7 +127,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x] + node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x, 24.x] runs-on: ${{ matrix.os }} From c6aa9458b133020ec6b043e76d9b4294796ed21a Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Mon, 4 Aug 2025 19:21:35 +0300 Subject: [PATCH 2/4] test: fix --- test/emit-option.test.js | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/test/emit-option.test.js b/test/emit-option.test.js index 1d46d924..18c5c9c4 100644 --- a/test/emit-option.test.js +++ b/test/emit-option.test.js @@ -315,42 +315,38 @@ describe("emit option", () => { await del([outputPath]); - const compiler1 = webpack(webpackConfig); + const compiler = webpack(webpackConfig); await new Promise((resolve, reject) => { - compiler1.run((error, stats) => { + compiler.run((error, stats) => { if (error) { reject(error); return; } - compiler1.close(() => { - expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot( - `assets` - ); - expect( - Array.from(stats.compilation.emittedAssets).sort() - ).toMatchSnapshot(`emittedAssets`); - expect(getWarnings(stats)).toMatchSnapshot("warnings"); - expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot( + `assets` + ); + expect( + Array.from(stats.compilation.emittedAssets).sort() + ).toMatchSnapshot(`emittedAssets`); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); - resolve(); - }); + resolve(); }); }); - const compiler2 = webpack(webpackConfig); - await new Promise((resolve, reject) => { - compiler2.run((error, stats) => { + compiler.run((error, stats) => { if (error) { reject(error); return; } - compiler2.close(() => { + compiler.close(() => { expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot( `assets` ); From 0477f37b1a88a55c53513b2f9767910e3fba55fc Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Mon, 4 Aug 2025 19:24:51 +0300 Subject: [PATCH 3/4] test: fix --- test/TestCases.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/TestCases.test.js b/test/TestCases.test.js index 2374a9c2..de82bedf 100644 --- a/test/TestCases.test.js +++ b/test/TestCases.test.js @@ -23,7 +23,7 @@ function clearDirectory(dirPath) { for (let i = 0; i < files.length; i++) { const filePath = `${dirPath}/${files[i]}`; - if (fs.statSync(filePath).isFile()) { + if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) { fs.unlinkSync(filePath); } else { clearDirectory(filePath); From bf26ea16559c881f5d5db0cc10dab6d37abcf896 Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Mon, 4 Aug 2025 19:27:54 +0300 Subject: [PATCH 4/4] test: fix --- test/TestCases.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/TestCases.test.js b/test/TestCases.test.js index de82bedf..ed4a7c9b 100644 --- a/test/TestCases.test.js +++ b/test/TestCases.test.js @@ -31,7 +31,11 @@ function clearDirectory(dirPath) { } } - fs.rmdirSync(dirPath); + try { + fs.rmdirSync(dirPath); + } catch (_err) { + // Nothing + } } function compareDirectory(actual, expected) {