@@ -315,42 +315,38 @@ describe("emit option", () => {
315
315
316
316
await del ( [ outputPath ] ) ;
317
317
318
- const compiler1 = webpack ( webpackConfig ) ;
318
+ const compiler = webpack ( webpackConfig ) ;
319
319
320
320
await new Promise ( ( resolve , reject ) => {
321
- compiler1 . run ( ( error , stats ) => {
321
+ compiler . run ( ( error , stats ) => {
322
322
if ( error ) {
323
323
reject ( error ) ;
324
324
325
325
return ;
326
326
}
327
327
328
- compiler1 . close ( ( ) => {
329
- expect ( Object . keys ( stats . compilation . assets ) . sort ( ) ) . toMatchSnapshot (
330
- `assets`
331
- ) ;
332
- expect (
333
- Array . from ( stats . compilation . emittedAssets ) . sort ( )
334
- ) . toMatchSnapshot ( `emittedAssets` ) ;
335
- expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
336
- expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
328
+ expect ( Object . keys ( stats . compilation . assets ) . sort ( ) ) . toMatchSnapshot (
329
+ `assets`
330
+ ) ;
331
+ expect (
332
+ Array . from ( stats . compilation . emittedAssets ) . sort ( )
333
+ ) . toMatchSnapshot ( `emittedAssets` ) ;
334
+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( "warnings" ) ;
335
+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( "errors" ) ;
337
336
338
- resolve ( ) ;
339
- } ) ;
337
+ resolve ( ) ;
340
338
} ) ;
341
339
} ) ;
342
340
343
- const compiler2 = webpack ( webpackConfig ) ;
344
-
345
341
await new Promise ( ( resolve , reject ) => {
346
- compiler2 . run ( ( error , stats ) => {
342
+ compiler . run ( ( error , stats ) => {
347
343
if ( error ) {
348
344
reject ( error ) ;
349
345
350
346
return ;
351
347
}
352
348
353
- compiler2 . close ( ( ) => {
349
+ compiler . close ( ( ) => {
354
350
expect ( Object . keys ( stats . compilation . assets ) . sort ( ) ) . toMatchSnapshot (
355
351
`assets`
356
352
) ;
0 commit comments