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
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}

Expand Down
8 changes: 6 additions & 2 deletions test/TestCases.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ 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);
}
}
}

fs.rmdirSync(dirPath);
try {
fs.rmdirSync(dirPath);
} catch (_err) {
// Nothing
}
}

function compareDirectory(actual, expected) {
Expand Down
30 changes: 13 additions & 17 deletions test/emit-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
);
Expand Down
Loading