Skip to content

Commit

Permalink
update rimraf usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Feb 29, 2024
1 parent 2788f21 commit ac9d978
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/rspack-plugin-html/tests/basic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ describe("HtmlWebpackPlugin", () => {
jest.setTimeout(process.env.CI ? 120000 : 10000);

beforeEach(done => {
rimraf(OUTPUT_DIR, done);
rimraf.sync(OUTPUT_DIR);
done();
});

it("generates a default index.html file for a single entry point", done => {
Expand Down
5 changes: 3 additions & 2 deletions packages/rspack/tests/TestCases.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const describeCases = config => {
emitOnErrors: true,
minimizer: [terserForTesting],
...testConfig.optimization
}
}
: {
removeAvailableModules: true,
removeEmptyChunks: true,
Expand Down Expand Up @@ -242,7 +242,8 @@ const describeCases = config => {
for (const fn of cleanups) fn();
});
beforeAll(done => {
rimraf(cacheDirectory, done);
rimraf.sync(cacheDirectory);
done();
});
if (config.cache) {
it(
Expand Down
10 changes: 6 additions & 4 deletions packages/rspack/tests/WatchTestCases.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ const describeCases = config => {
.map(name => ({ name }));

beforeAll(done => {
rimraf(tempDirectory, done);
rimraf.sync(tempDirectory);
done();
});

it(
Expand Down Expand Up @@ -349,9 +350,10 @@ const describeCases = config => {
let testConfig = {};
try {
// try to load a test file
testConfig = require(
path.join(testDirectory, "test.config.js")
);
testConfig = require(path.join(
testDirectory,
"test.config.js"
));
} catch (e) {
// empty
}
Expand Down

0 comments on commit ac9d978

Please sign in to comment.