11"use strict" ;
22
3+ const fs = require ( "fs" ) ;
34const path = require ( "path" ) ;
4- const rimraf = require ( "rimraf" ) ;
55const { run } = require ( "../../utils/test-utils" ) ;
66
77describe ( "cache" , ( ) => {
88 it ( "should work" , async ( ) => {
9- rimraf . sync (
9+ fs . rmSync (
1010 path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-default-development" ) ,
11+ { recursive : true , force : true } ,
1112 ) ;
1213
1314 let { exitCode, stderr, stdout } = await run ( __dirname , [ "-c" , "./webpack.config.js" ] ) ;
@@ -29,11 +30,13 @@ describe("cache", () => {
2930 } ) ;
3031
3132 it ( "should work in multi compiler mode" , async ( ) => {
32- rimraf . sync (
33+ fs . rmSync (
3334 path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-first-development" ) ,
35+ { recursive : true , force : true } ,
3436 ) ;
35- rimraf . sync (
37+ fs . rmSync (
3638 path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-second-development" ) ,
39+ { recursive : true , force : true } ,
3740 ) ;
3841
3942 let { exitCode, stderr, stdout } = await run ( __dirname , [ "-c" , "./multi.config.js" ] ) ;
@@ -55,8 +58,9 @@ describe("cache", () => {
5558 } ) ;
5659
5760 it ( "should work in multi compiler mode with the `--config-name` argument" , async ( ) => {
58- rimraf . sync (
61+ fs . rmSync (
5962 path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-third-development" ) ,
63+ { recursive : true , force : true } ,
6064 ) ;
6165
6266 let { exitCode, stderr, stdout } = await run ( __dirname , [
@@ -92,8 +96,9 @@ describe("cache", () => {
9296 } ) ;
9397
9498 it ( "should work with the `--merge` argument" , async ( ) => {
95- rimraf . sync (
99+ fs . rmSync (
96100 path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-fourth-development" ) ,
101+ { recursive : true , force : true } ,
97102 ) ;
98103
99104 let { exitCode, stderr, stdout } = await run ( __dirname , [
@@ -131,8 +136,9 @@ describe("cache", () => {
131136 } ) ;
132137
133138 it ( "should work with the `--config-name` and `--merge` argument" , async ( ) => {
134- rimraf . sync (
139+ fs . rmSync (
135140 path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-fifth-development" ) ,
141+ { recursive : true , force : true } ,
136142 ) ;
137143
138144 let { exitCode, stderr, stdout } = await run ( __dirname , [
@@ -178,11 +184,12 @@ describe("cache", () => {
178184 } ) ;
179185
180186 it ( "should work with autoloading configuration" , async ( ) => {
181- rimraf . sync (
187+ fs . rmSync (
182188 path . join (
183189 __dirname ,
184190 "../../../node_modules/.cache/webpack/cache-test-autoloading-development" ,
185191 ) ,
192+ { recursive : true , force : true } ,
186193 ) ;
187194
188195 let { exitCode, stderr, stdout } = await run ( __dirname , [ "--name" , "cache-test-autoloading" ] ) ;
0 commit comments