@@ -37,15 +37,13 @@ describe('plugins/terser', () => {
37
37
const config = createConfig ( ) ;
38
38
39
39
config . configureTerserPlugin ( ( options ) => {
40
- options . terserOptions = {
41
- output : { beautify : true }
42
- } ;
40
+ options . test = 'custom_test' ;
43
41
} ) ;
44
42
45
43
const plugin = terserPluginUtil ( config ) ;
46
44
47
45
// Allows to override default options
48
- expect ( plugin . options . terserOptions . output . beautify ) . to . equal ( true ) ;
46
+ expect ( plugin . options . test ) . to . equal ( 'custom_test' ) ;
49
47
50
48
// Doesn't remove default options
51
49
expect ( plugin . options . parallel ) . to . equal ( true ) ;
@@ -55,16 +53,14 @@ describe('plugins/terser', () => {
55
53
const config = createConfig ( ) ;
56
54
57
55
config . configureTerserPlugin ( ( options ) => {
58
- options . terserOptions = {
59
- output : { beautify : true }
60
- } ;
56
+ options . test = 'custom_test' ;
61
57
62
58
// This should override the original config
63
59
return { parallel : false } ;
64
60
} ) ;
65
61
66
62
const plugin = terserPluginUtil ( config ) ;
67
- expect ( plugin . options . terserOptions . output ) . to . be . undefined ;
63
+ expect ( plugin . options . test ) . to . not . equal ( 'custom_test' ) ;
68
64
expect ( plugin . options . parallel ) . to . equal ( false ) ;
69
65
} ) ;
70
66
} ) ;
0 commit comments