@@ -15,7 +15,6 @@ const RuntimeConfig = require('../lib/config/RuntimeConfig');
1515const configGenerator = require ( '../lib/config-generator' ) ;
1616const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
1717const { WebpackManifestPlugin } = require ( '../lib/webpack-manifest-plugin' ) ;
18- const { CleanWebpackPlugin } = require ( 'clean-webpack-plugin' ) ;
1918const webpack = require ( 'webpack' ) ;
2019const path = require ( 'path' ) ;
2120const logger = require ( '../lib/logger' ) ;
@@ -534,7 +533,7 @@ describe('The config-generator function', () => {
534533 } ) ;
535534 } ) ;
536535
537- describe ( 'cleanupOutputBeforeBuild() adds CleanWebpackPlugin ' , ( ) => {
536+ describe ( 'cleanupOutputBeforeBuild() configures output cleaning ' , ( ) => {
538537 it ( 'without cleanupOutputBeforeBuild()' , ( ) => {
539538 const config = createConfig ( ) ;
540539 config . outputPath = '/tmp/output/public-path' ;
@@ -543,8 +542,7 @@ describe('The config-generator function', () => {
543542
544543 const actualConfig = configGenerator ( config ) ;
545544
546- const cleanPlugin = findPlugin ( CleanWebpackPlugin , actualConfig . plugins ) ;
547- expect ( cleanPlugin ) . to . be . undefined ;
545+ expect ( actualConfig . output . clean ) . to . be . false ;
548546 } ) ;
549547
550548 it ( 'with cleanupOutputBeforeBuild()' , ( ) => {
@@ -556,8 +554,7 @@ describe('The config-generator function', () => {
556554
557555 const actualConfig = configGenerator ( config ) ;
558556
559- const cleanPlugin = findPlugin ( CleanWebpackPlugin , actualConfig . plugins ) ;
560- expect ( cleanPlugin ) . to . not . be . undefined ;
557+ expect ( actualConfig . output . clean ) . to . deep . equals ( { } ) ;
561558 } ) ;
562559 } ) ;
563560
0 commit comments