1
1
"use strict" ;
2
2
3
+ const fs = require ( "fs" ) ;
3
4
const path = require ( "path" ) ;
4
- const rimraf = require ( "rimraf" ) ;
5
5
const { run } = require ( "../../utils/test-utils" ) ;
6
6
7
7
describe ( "cache" , ( ) => {
8
8
it ( "should work" , async ( ) => {
9
- rimraf . sync (
9
+ fs . rmSync (
10
10
path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-default-development" ) ,
11
+ { recursive : true , force : true } ,
11
12
) ;
12
13
13
14
let { exitCode, stderr, stdout } = await run ( __dirname , [ "-c" , "./webpack.config.js" ] ) ;
@@ -29,11 +30,13 @@ describe("cache", () => {
29
30
} ) ;
30
31
31
32
it ( "should work in multi compiler mode" , async ( ) => {
32
- rimraf . sync (
33
+ fs . rmSync (
33
34
path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-first-development" ) ,
35
+ { recursive : true , force : true } ,
34
36
) ;
35
- rimraf . sync (
37
+ fs . rmSync (
36
38
path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-second-development" ) ,
39
+ { recursive : true , force : true } ,
37
40
) ;
38
41
39
42
let { exitCode, stderr, stdout } = await run ( __dirname , [ "-c" , "./multi.config.js" ] ) ;
@@ -55,8 +58,9 @@ describe("cache", () => {
55
58
} ) ;
56
59
57
60
it ( "should work in multi compiler mode with the `--config-name` argument" , async ( ) => {
58
- rimraf . sync (
61
+ fs . rmSync (
59
62
path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-third-development" ) ,
63
+ { recursive : true , force : true } ,
60
64
) ;
61
65
62
66
let { exitCode, stderr, stdout } = await run ( __dirname , [
@@ -92,8 +96,9 @@ describe("cache", () => {
92
96
} ) ;
93
97
94
98
it ( "should work with the `--merge` argument" , async ( ) => {
95
- rimraf . sync (
99
+ fs . rmSync (
96
100
path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-fourth-development" ) ,
101
+ { recursive : true , force : true } ,
97
102
) ;
98
103
99
104
let { exitCode, stderr, stdout } = await run ( __dirname , [
@@ -131,8 +136,9 @@ describe("cache", () => {
131
136
} ) ;
132
137
133
138
it ( "should work with the `--config-name` and `--merge` argument" , async ( ) => {
134
- rimraf . sync (
139
+ fs . rmSync (
135
140
path . join ( __dirname , "../../../node_modules/.cache/webpack/cache-test-fifth-development" ) ,
141
+ { recursive : true , force : true } ,
136
142
) ;
137
143
138
144
let { exitCode, stderr, stdout } = await run ( __dirname , [
@@ -178,11 +184,12 @@ describe("cache", () => {
178
184
} ) ;
179
185
180
186
it ( "should work with autoloading configuration" , async ( ) => {
181
- rimraf . sync (
187
+ fs . rmSync (
182
188
path . join (
183
189
__dirname ,
184
190
"../../../node_modules/.cache/webpack/cache-test-autoloading-development" ,
185
191
) ,
192
+ { recursive : true , force : true } ,
186
193
) ;
187
194
188
195
let { exitCode, stderr, stdout } = await run ( __dirname , [ "--name" , "cache-test-autoloading" ] ) ;
0 commit comments