@@ -3,24 +3,31 @@ const resolveAdvanced = require('../lib/groups/resolveAdvanced');
33const targetValues = [ 'web' , 'webworker' , 'node' , 'async-node' , 'node-webkit' , 'electron-main' , 'electron-renderer' , 'electron-preload' ] ;
44
55describe ( 'advanced options' , function ( ) {
6- it ( 'should load the HMR plugin' , ( ) => {
7- const result = resolveAdvanced ( {
6+ it ( 'should load the HMR plugin' , async ( ) => {
7+ const result = await resolveAdvanced ( {
88 hot : true ,
99 } ) ;
1010 expect ( result . options . plugins [ 0 ] . constructor . name ) . toEqual ( 'HotModuleReplacementPlugin' ) ;
1111 } ) ;
1212
13- it ( 'should load the prefetch plugin' , ( ) => {
14- const result = resolveAdvanced ( {
13+ it ( 'should load the prefetch plugin' , async ( ) => {
14+ const result = await resolveAdvanced ( {
1515 prefetch : 'url' ,
1616 } ) ;
1717 expect ( result . options . plugins [ 0 ] . constructor . name ) . toEqual ( 'PrefetchPlugin' ) ;
1818 } ) ;
1919
20+ it ( 'should load the webpack-bundle-analyzer plugin' , async ( ) => {
21+ const result = await resolveAdvanced ( {
22+ analyze : true ,
23+ } ) ;
24+ expect ( result . options . plugins [ 0 ] . constructor . name ) . toEqual ( 'BundleAnalyzerPlugin' ) ;
25+ } ) ;
26+
2027 {
2128 targetValues . map ( ( option ) => {
22- it ( `should handle ${ option } option` , ( ) => {
23- const result = resolveAdvanced ( {
29+ it ( `should handle ${ option } option` , async ( ) => {
30+ const result = await resolveAdvanced ( {
2431 target : option ,
2532 } ) ;
2633 expect ( result . options . target ) . toEqual ( option ) ;
0 commit comments