Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Commit 38b59b8

Browse files
test(invalid-options): update snapshots
1 parent 426bafd commit 38b59b8

File tree

2 files changed

+102
-12
lines changed

2 files changed

+102
-12
lines changed

test/__snapshots__/invalid-options.test.js.snap

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,93 @@ exports[`manifest.6afe1bc6685e9ab36c1c.js 1`] = `
183183
`;
184184

185185
exports[`warnings 1`] = `Array []`;
186+
187+
exports[`when applied with invalid options throws validation errors 1`] = `
188+
"UglifyJs Plugin Invalid Options
189+
190+
options['doesntExist'] should NOT have additional properties
191+
"
192+
`;
193+
194+
exports[`when applied with invalid options throws validation errors 2`] = `
195+
"UglifyJs Plugin Invalid Options
196+
197+
options.cache should be boolean
198+
options.cache should be string
199+
options.cache should match exactly one schema in oneOf
200+
"
201+
`;
202+
203+
exports[`when applied with invalid options throws validation errors 3`] = `
204+
"UglifyJs Plugin Invalid Options
205+
206+
options.parallel should be boolean
207+
options.parallel should be integer
208+
options.parallel should match exactly one schema in oneOf
209+
"
210+
`;
211+
212+
exports[`when applied with invalid options throws validation errors 4`] = `
213+
"UglifyJs Plugin Invalid Options
214+
215+
options.parallel should be boolean
216+
options.parallel should be integer
217+
options.parallel should match exactly one schema in oneOf
218+
"
219+
`;
220+
221+
exports[`when applied with invalid options throws validation errors 5`] = `
222+
"UglifyJs Plugin Invalid Options
223+
224+
options.sourceMap should be boolean
225+
"
226+
`;
227+
228+
exports[`when applied with invalid options throws validation errors 6`] = `
229+
"UglifyJs Plugin Invalid Options
230+
231+
options.uglifyOptions should be object
232+
"
233+
`;
234+
235+
exports[`when applied with invalid options throws validation errors 7`] = `
236+
"UglifyJs Plugin Invalid Options
237+
238+
options.uglifyOptions.ie8 should be boolean
239+
"
240+
`;
241+
242+
exports[`when applied with invalid options throws validation errors 8`] = `
243+
"UglifyJs Plugin Invalid Options
244+
245+
options.uglifyOptions.ecma should be integer
246+
"
247+
`;
248+
249+
exports[`when applied with invalid options throws validation errors 9`] = `
250+
"UglifyJs Plugin Invalid Options
251+
252+
options.uglifyOptions.ecma should be integer
253+
"
254+
`;
255+
256+
exports[`when applied with invalid options throws validation errors 10`] = `
257+
"UglifyJs Plugin Invalid Options
258+
259+
options.uglifyOptions.ecma should be integer
260+
"
261+
`;
262+
263+
exports[`when applied with invalid options throws validation errors 11`] = `
264+
"UglifyJs Plugin Invalid Options
265+
266+
options.uglifyOptions.ecma should be >= 5
267+
"
268+
`;
269+
270+
exports[`when applied with invalid options throws validation errors 12`] = `
271+
"UglifyJs Plugin Invalid Options
272+
273+
options.uglifyOptions.ecma should be <= 8
274+
"
275+
`;

test/invalid-options.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('when applied with invalid options', () => {
4040

4141
expect(() => {
4242
new UglifyJsPlugin({ doesntExist: true });
43-
}).toThrow('Validation Error');
43+
}).toThrowErrorMatchingSnapshot();
4444

4545
expect(() => {
4646
new UglifyJsPlugin({ cache: true });
@@ -52,7 +52,7 @@ describe('when applied with invalid options', () => {
5252

5353
expect(() => {
5454
new UglifyJsPlugin({ cache: {} });
55-
}).toThrow('Validation Error');
55+
}).toThrowErrorMatchingSnapshot();
5656

5757
expect(() => {
5858
new UglifyJsPlugin({ parallel: true });
@@ -64,23 +64,23 @@ describe('when applied with invalid options', () => {
6464

6565
expect(() => {
6666
new UglifyJsPlugin({ parallel: '2' });
67-
}).toThrow('Validation Error');
67+
}).toThrowErrorMatchingSnapshot();
6868

6969
expect(() => {
7070
new UglifyJsPlugin({ parallel: {} });
71-
}).toThrow('Validation Error');
71+
}).toThrowErrorMatchingSnapshot();
7272

7373
expect(() => {
7474
new UglifyJsPlugin({ sourceMap: true });
7575
}).not.toThrow('Validation Error');
7676

7777
expect(() => {
7878
new UglifyJsPlugin({ sourceMap: 'true' });
79-
}).toThrow('Validation Error');
79+
}).toThrowErrorMatchingSnapshot();
8080

8181
expect(() => {
8282
new UglifyJsPlugin({ uglifyOptions: null });
83-
}).toThrow('Validation Error');
83+
}).toThrowErrorMatchingSnapshot();
8484

8585
expect(() => {
8686
new UglifyJsPlugin({ uglifyOptions: { ie8: false } });
@@ -92,7 +92,7 @@ describe('when applied with invalid options', () => {
9292

9393
expect(() => {
9494
new UglifyJsPlugin({ uglifyOptions: { ie8: 'false' } });
95-
}).toThrow('Validation Error');
95+
}).toThrowErrorMatchingSnapshot();
9696

9797
expect(() => {
9898
new UglifyJsPlugin({ uglifyOptions: { emca: 5 } });
@@ -104,23 +104,23 @@ describe('when applied with invalid options', () => {
104104

105105
expect(() => {
106106
new UglifyJsPlugin({ uglifyOptions: { ecma: 7.5 } });
107-
}).toThrow('should be integer');
107+
}).toThrowErrorMatchingSnapshot();
108108

109109
expect(() => {
110110
new UglifyJsPlugin({ uglifyOptions: { ecma: true } });
111-
}).toThrow('should be integer');
111+
}).toThrowErrorMatchingSnapshot();
112112

113113
expect(() => {
114114
new UglifyJsPlugin({ uglifyOptions: { ecma: '5' } });
115-
}).toThrow('should be integer');
115+
}).toThrowErrorMatchingSnapshot();
116116

117117
expect(() => {
118118
new UglifyJsPlugin({ uglifyOptions: { ecma: 3 } });
119-
}).toThrow('should be >= 5');
119+
}).toThrowErrorMatchingSnapshot();
120120

121121
expect(() => {
122122
new UglifyJsPlugin({ uglifyOptions: { ecma: 10 } });
123-
}).toThrow('should be <= 8');
123+
}).toThrowErrorMatchingSnapshot();
124124
});
125125

126126
it('outputs uglify errors', () => {

0 commit comments

Comments
 (0)