Skip to content

Commit

Permalink
chore(deps): avoid using rimraf
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Dec 18, 2024
1 parent 8c4a51a commit d04ffe9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"nyc": "^17.1.0",
"prettier": "^3.3.3",
"readable-stream": "^4.5.2",
"rimraf": "^3.0.2",
"sass": "^1.54.9",
"sass-loader": "^16.0.2",
"strip-ansi": "^6.0.1",
Expand Down
6 changes: 4 additions & 2 deletions scripts/cleanup-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const rimraf = require("rimraf");
const fs = require("fs");
const { join } = require("path");
const collectTestFolders = require("./utils");

Expand All @@ -21,7 +21,9 @@ const folderStrategy = (stats, file) => {

const cleanupOutputDirs = () => {
for (const outputFolder of collectTestFolders(folderStrategy)) {
outputDirectories.forEach((dir) => rimraf.sync(join(outputFolder, dir)));
outputDirectories.forEach((dir) =>
fs.rmSync(join(outputFolder, dir), { recursive: true, force: true }),
);
}
};

Expand Down
23 changes: 15 additions & 8 deletions test/build/cache/cache.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"use strict";

const fs = require("fs");
const path = require("path");
const rimraf = require("rimraf");
const { run } = require("../../utils/test-utils");

describe("cache", () => {
it("should work", async () => {
rimraf.sync(
fs.rmSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-default-development"),
{ recursive: true, force: true },
);

let { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.js"]);
Expand All @@ -29,11 +30,13 @@ describe("cache", () => {
});

it("should work in multi compiler mode", async () => {
rimraf.sync(
fs.rmSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-first-development"),
{ recursive: true, force: true },
);
rimraf.sync(
fs.rmSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-second-development"),
{ recursive: true, force: true },
);

let { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./multi.config.js"]);
Expand All @@ -55,8 +58,9 @@ describe("cache", () => {
});

it("should work in multi compiler mode with the `--config-name` argument", async () => {
rimraf.sync(
fs.rmSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-third-development"),
{ recursive: true, force: true },
);

let { exitCode, stderr, stdout } = await run(__dirname, [
Expand Down Expand Up @@ -92,8 +96,9 @@ describe("cache", () => {
});

it("should work with the `--merge` argument", async () => {
rimraf.sync(
fs.rmSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-fourth-development"),
{ recursive: true, force: true },
);

let { exitCode, stderr, stdout } = await run(__dirname, [
Expand Down Expand Up @@ -131,8 +136,9 @@ describe("cache", () => {
});

it("should work with the `--config-name` and `--merge` argument", async () => {
rimraf.sync(
fs.rmSync(
path.join(__dirname, "../../../node_modules/.cache/webpack/cache-test-fifth-development"),
{ recursive: true, force: true },
);

let { exitCode, stderr, stdout } = await run(__dirname, [
Expand Down Expand Up @@ -178,11 +184,12 @@ describe("cache", () => {
});

it("should work with autoloading configuration", async () => {
rimraf.sync(
fs.rmSync(
path.join(
__dirname,
"../../../node_modules/.cache/webpack/cache-test-autoloading-development",
),
{ recursive: true, force: true },
);

let { exitCode, stderr, stdout } = await run(__dirname, ["--name", "cache-test-autoloading"]);
Expand Down

0 comments on commit d04ffe9

Please sign in to comment.