This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
/
UglifyJsPlugin.test.js.snap
234 lines (198 loc) · 7.93 KB
/
UglifyJsPlugin.test.js.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`UglifyJsPlugin should contains error when uglify has unknown option: errors 1`] = `
Array [
"Error: main.0c220ec66316af2c1b24.js from UglifyJs
DefaultsError: \`unknown\` is not a supported option",
"Error: manifest.d6857f782c13a99b5917.js from UglifyJs
DefaultsError: \`unknown\` is not a supported option",
]
`;
exports[`UglifyJsPlugin should contains error when uglify has unknown option: main.0c220ec66316af2c1b24.js 1`] = `
"webpackJsonp([0],[
/* 0 */
/***/ (function(module, exports) {
// foo
/* @preserve*/
// bar
const a = 2 + 2;
module.exports = function Foo() {
const b = 2 + 2;
console.log(b + 1 + 2);
};
/***/ })
],[0]);"
`;
exports[`UglifyJsPlugin should contains error when uglify has unknown option: manifest.d6857f782c13a99b5917.js 1`] = `
"/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ var parentJsonpFunction = window[\\"webpackJsonp\\"];
/******/ window[\\"webpackJsonp\\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {
/******/ // add \\"moreModules\\" to the modules object,
/******/ // then flag all \\"chunkIds\\" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [], result;
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/ if(executeModules) {
/******/ for(i=0; i < executeModules.length; i++) {
/******/ result = __webpack_require__(__webpack_require__.s = executeModules[i]);
/******/ }
/******/ }
/******/ return result;
/******/ };
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // objects to store loaded and loading chunks
/******/ var installedChunks = {
/******/ 1: 0
/******/ };
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = \\"\\";
/******/
/******/ // on error function for async loading
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
/******/ })
/************************************************************************/
/******/ ([]);"
`;
exports[`UglifyJsPlugin should contains error when uglify has unknown option: warnings 1`] = `Array []`;
exports[`UglifyJsPlugin should handle validation errors 1`] = `
"UglifyJs Plugin Invalid Options
options['doesntExist'] is an invalid additional property
"
`;
exports[`UglifyJsPlugin should handle validation errors 2`] = `
"UglifyJs Plugin Invalid Options
options.cache should be boolean
options.cache should be string
options.cache should match exactly one schema in oneOf
"
`;
exports[`UglifyJsPlugin should handle validation errors 3`] = `
"UglifyJs Plugin Invalid Options
options.parallel should be boolean
options.parallel should be integer
options.parallel should match exactly one schema in oneOf
"
`;
exports[`UglifyJsPlugin should handle validation errors 4`] = `
"UglifyJs Plugin Invalid Options
options.parallel should be boolean
options.parallel should be integer
options.parallel should match exactly one schema in oneOf
"
`;
exports[`UglifyJsPlugin should handle validation errors 5`] = `
"UglifyJs Plugin Invalid Options
options.sourceMap should be boolean
"
`;
exports[`UglifyJsPlugin should handle validation errors 6`] = `
"UglifyJs Plugin Invalid Options
options.uglifyOptions should be object
"
`;
exports[`UglifyJsPlugin should handle validation errors 7`] = `
"UglifyJs Plugin Invalid Options
options.uglifyOptions.ie8 should be boolean
"
`;
exports[`UglifyJsPlugin should handle validation errors 8`] = `
"UglifyJs Plugin Invalid Options
options.uglifyOptions.ecma should be integer
"
`;
exports[`UglifyJsPlugin should handle validation errors 9`] = `
"UglifyJs Plugin Invalid Options
options.uglifyOptions.ecma should be integer
"
`;
exports[`UglifyJsPlugin should handle validation errors 10`] = `
"UglifyJs Plugin Invalid Options
options.uglifyOptions.ecma should be integer
"
`;
exports[`UglifyJsPlugin should handle validation errors 11`] = `
"UglifyJs Plugin Invalid Options
options.uglifyOptions.ecma should be >= 5
"
`;
exports[`UglifyJsPlugin should handle validation errors 12`] = `
"UglifyJs Plugin Invalid Options
options.uglifyOptions.ecma should be <= 8
"
`;
exports[`UglifyJsPlugin when applied with no options matches snapshot: errors 1`] = `Array []`;
exports[`UglifyJsPlugin when applied with no options matches snapshot: main.0c220ec66316af2c1b24.js 1`] = `"webpackJsonp([0],[function(o,n){o.exports=function(){console.log(7)}}],[0]);"`;
exports[`UglifyJsPlugin when applied with no options matches snapshot: manifest.d6857f782c13a99b5917.js 1`] = `"!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a<e.length;a++)i=e[a],o[i]&&l.push(o[i][0]),o[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=t(t.s=c[a]);return p};var e={},o={1:0};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=e,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,\\"a\\",n),n},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},t.p=\\"\\",t.oe=function(r){throw console.error(r),r}}([]);"`;
exports[`UglifyJsPlugin when applied with no options matches snapshot: warnings 1`] = `Array []`;