@@ -3,24 +3,31 @@ const resolveAdvanced = require('../lib/groups/resolveAdvanced');
3
3
const targetValues = [ 'web' , 'webworker' , 'node' , 'async-node' , 'node-webkit' , 'electron-main' , 'electron-renderer' , 'electron-preload' ] ;
4
4
5
5
describe ( '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 ( {
8
8
hot : true ,
9
9
} ) ;
10
10
expect ( result . options . plugins [ 0 ] . constructor . name ) . toEqual ( 'HotModuleReplacementPlugin' ) ;
11
11
} ) ;
12
12
13
- it ( 'should load the prefetch plugin' , ( ) => {
14
- const result = resolveAdvanced ( {
13
+ it ( 'should load the prefetch plugin' , async ( ) => {
14
+ const result = await resolveAdvanced ( {
15
15
prefetch : 'url' ,
16
16
} ) ;
17
17
expect ( result . options . plugins [ 0 ] . constructor . name ) . toEqual ( 'PrefetchPlugin' ) ;
18
18
} ) ;
19
19
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
+
20
27
{
21
28
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 ( {
24
31
target : option ,
25
32
} ) ;
26
33
expect ( result . options . target ) . toEqual ( option ) ;
0 commit comments