Skip to content

Commit 6ba065d

Browse files
committed
asserting a different option for terser-webpack-plugin
Something in terser-webpack-plugin changed internally, and the terserOptions are stored elsewhere.
1 parent ded0880 commit 6ba065d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

test/plugins/terser.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@ describe('plugins/terser', () => {
3737
const config = createConfig();
3838

3939
config.configureTerserPlugin((options) => {
40-
options.terserOptions = {
41-
output: { beautify: true }
42-
};
40+
options.test = 'custom_test';
4341
});
4442

4543
const plugin = terserPluginUtil(config);
4644

4745
// Allows to override default options
48-
expect(plugin.options.terserOptions.output.beautify).to.equal(true);
46+
expect(plugin.options.test).to.equal('custom_test');
4947

5048
// Doesn't remove default options
5149
expect(plugin.options.parallel).to.equal(true);
@@ -55,16 +53,14 @@ describe('plugins/terser', () => {
5553
const config = createConfig();
5654

5755
config.configureTerserPlugin((options) => {
58-
options.terserOptions = {
59-
output: { beautify: true }
60-
};
56+
options.test = 'custom_test';
6157

6258
// This should override the original config
6359
return { parallel: false };
6460
});
6561

6662
const plugin = terserPluginUtil(config);
67-
expect(plugin.options.terserOptions.output).to.be.undefined;
63+
expect(plugin.options.test).to.not.equal('custom_test');
6864
expect(plugin.options.parallel).to.equal(false);
6965
});
7066
});

0 commit comments

Comments
 (0)