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

Commit 817f67e

Browse files
refactor: tests (#334)
* refactor: move `ecma` test to `uglifyOptions` test * refactor: tests for `test`, `include` and `exclude` options * refactor: `parallel` test * refactor: merge `extractComments` option tests
1 parent 726874b commit 817f67e

14 files changed

+1162
-1008
lines changed

test/__snapshots__/ecma.test.js.snap

Lines changed: 0 additions & 346 deletions
This file was deleted.

test/__snapshots__/exclude-option.test.js.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`when applied with exclude option matches snapshot for a single exclude: entry.a3533847fa24ef98733c.js 1`] = `"webpackJsonp([2],{2:function(o,n){o.exports=function(){console.log(7)}}},[2]);"`;
3+
exports[`when applied with exclude option matches snapshot for a single exclude value: entry.a3533847fa24ef98733c.js 1`] = `"webpackJsonp([2],{2:function(o,n){o.exports=function(){console.log(7)}}},[2]);"`;
44

5-
exports[`when applied with exclude option matches snapshot for a single exclude: errors 1`] = `Array []`;
5+
exports[`when applied with exclude option matches snapshot for a single exclude value: errors 1`] = `Array []`;
66

7-
exports[`when applied with exclude option matches snapshot for a single exclude: excluded1.4d3a1b43eccbc2acc9d6.js 1`] = `
7+
exports[`when applied with exclude option matches snapshot for a single exclude value: excluded1.4d3a1b43eccbc2acc9d6.js 1`] = `
88
"webpackJsonp([1],[
99
/* 0 */
1010
/***/ (function(module, exports) {
@@ -18,17 +18,17 @@ module.exports = function Bar1() {
1818
],[0]);"
1919
`;
2020

21-
exports[`when applied with exclude option matches snapshot for a single exclude: excluded2.a96f544a34079b25c7b4.js 1`] = `"webpackJsonp([0],[,function(o,n){o.exports=function(){console.log(7)}}],[1]);"`;
21+
exports[`when applied with exclude option matches snapshot for a single exclude value: excluded2.a96f544a34079b25c7b4.js 1`] = `"webpackJsonp([0],[,function(o,n){o.exports=function(){console.log(7)}}],[1]);"`;
2222

23-
exports[`when applied with exclude option matches snapshot for a single exclude: manifest.d37b2b873f771997c745.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={3: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}}([]);"`;
23+
exports[`when applied with exclude option matches snapshot for a single exclude value: manifest.d37b2b873f771997c745.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={3: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}}([]);"`;
2424

25-
exports[`when applied with exclude option matches snapshot for a single exclude: warnings 1`] = `Array []`;
25+
exports[`when applied with exclude option matches snapshot for a single exclude value: warnings 1`] = `Array []`;
2626

27-
exports[`when applied with exclude option matches snapshot for multiple excludes: entry.a3533847fa24ef98733c.js 1`] = `"webpackJsonp([2],{2:function(o,n){o.exports=function(){console.log(7)}}},[2]);"`;
27+
exports[`when applied with exclude option matches snapshot for multiple exclude values: entry.a3533847fa24ef98733c.js 1`] = `"webpackJsonp([2],{2:function(o,n){o.exports=function(){console.log(7)}}},[2]);"`;
2828

29-
exports[`when applied with exclude option matches snapshot for multiple excludes: errors 1`] = `Array []`;
29+
exports[`when applied with exclude option matches snapshot for multiple exclude values: errors 1`] = `Array []`;
3030

31-
exports[`when applied with exclude option matches snapshot for multiple excludes: excluded1.4d3a1b43eccbc2acc9d6.js 1`] = `
31+
exports[`when applied with exclude option matches snapshot for multiple exclude values: excluded1.4d3a1b43eccbc2acc9d6.js 1`] = `
3232
"webpackJsonp([1],[
3333
/* 0 */
3434
/***/ (function(module, exports) {
@@ -42,7 +42,7 @@ module.exports = function Bar1() {
4242
],[0]);"
4343
`;
4444

45-
exports[`when applied with exclude option matches snapshot for multiple excludes: excluded2.a96f544a34079b25c7b4.js 1`] = `
45+
exports[`when applied with exclude option matches snapshot for multiple exclude values: excluded2.a96f544a34079b25c7b4.js 1`] = `
4646
"webpackJsonp([0],[
4747
/* 0 */,
4848
/* 1 */
@@ -57,6 +57,6 @@ module.exports = function Bar2() {
5757
],[1]);"
5858
`;
5959

60-
exports[`when applied with exclude option matches snapshot for multiple excludes: manifest.d37b2b873f771997c745.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={3: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}}([]);"`;
60+
exports[`when applied with exclude option matches snapshot for multiple exclude values: manifest.d37b2b873f771997c745.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={3: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}}([]);"`;
6161

62-
exports[`when applied with exclude option matches snapshot for multiple excludes: warnings 1`] = `Array []`;
62+
exports[`when applied with exclude option matches snapshot for multiple exclude values: warnings 1`] = `Array []`;

test/__snapshots__/include-option.test.js.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`when applied with include option matches snapshot for a single include: entry.a3533847fa24ef98733c.js 1`] = `
3+
exports[`when applied with include option matches snapshot for a single include value: entry.a3533847fa24ef98733c.js 1`] = `
44
"webpackJsonp([2],{
55
66
/***/ 2:
@@ -22,11 +22,11 @@ module.exports = function Foo() {
2222
},[2]);"
2323
`;
2424

25-
exports[`when applied with include option matches snapshot for a single include: errors 1`] = `Array []`;
25+
exports[`when applied with include option matches snapshot for a single include value: errors 1`] = `Array []`;
2626

27-
exports[`when applied with include option matches snapshot for a single include: included1.3c000166b4174c9cb9a0.js 1`] = `"webpackJsonp([1],[function(o,n){o.exports=function(){console.log(7)}}],[0]);"`;
27+
exports[`when applied with include option matches snapshot for a single include value: included1.3c000166b4174c9cb9a0.js 1`] = `"webpackJsonp([1],[function(o,n){o.exports=function(){console.log(7)}}],[0]);"`;
2828

29-
exports[`when applied with include option matches snapshot for a single include: included2.110cfb201ee67fa7a412.js 1`] = `
29+
exports[`when applied with include option matches snapshot for a single include value: included2.110cfb201ee67fa7a412.js 1`] = `
3030
"webpackJsonp([0],[
3131
/* 0 */,
3232
/* 1 */
@@ -42,7 +42,7 @@ module.exports = function Bar2() {
4242
],[1]);"
4343
`;
4444

45-
exports[`when applied with include option matches snapshot for a single include: manifest.d37b2b873f771997c745.js 1`] = `
45+
exports[`when applied with include option matches snapshot for a single include value: manifest.d37b2b873f771997c745.js 1`] = `
4646
"/******/ (function(modules) { // webpackBootstrap
4747
/******/ // install a JSONP callback for chunk loading
4848
/******/ var parentJsonpFunction = window[\\"webpackJsonp\\"];
@@ -146,9 +146,9 @@ exports[`when applied with include option matches snapshot for a single include:
146146
/******/ ([]);"
147147
`;
148148

149-
exports[`when applied with include option matches snapshot for a single include: warnings 1`] = `Array []`;
149+
exports[`when applied with include option matches snapshot for a single include value: warnings 1`] = `Array []`;
150150

151-
exports[`when applied with include option matches snapshot for multiple includes: entry.a3533847fa24ef98733c.js 1`] = `
151+
exports[`when applied with include option matches snapshot for multiple include values: entry.a3533847fa24ef98733c.js 1`] = `
152152
"webpackJsonp([2],{
153153
154154
/***/ 2:
@@ -170,13 +170,13 @@ module.exports = function Foo() {
170170
},[2]);"
171171
`;
172172

173-
exports[`when applied with include option matches snapshot for multiple includes: errors 1`] = `Array []`;
173+
exports[`when applied with include option matches snapshot for multiple include values: errors 1`] = `Array []`;
174174

175-
exports[`when applied with include option matches snapshot for multiple includes: included1.3c000166b4174c9cb9a0.js 1`] = `"webpackJsonp([1],[function(o,n){o.exports=function(){console.log(7)}}],[0]);"`;
175+
exports[`when applied with include option matches snapshot for multiple include values: included1.3c000166b4174c9cb9a0.js 1`] = `"webpackJsonp([1],[function(o,n){o.exports=function(){console.log(7)}}],[0]);"`;
176176

177-
exports[`when applied with include option matches snapshot for multiple includes: included2.110cfb201ee67fa7a412.js 1`] = `"webpackJsonp([0],[,function(o,n){o.exports=function(){console.log(7)}}],[1]);"`;
177+
exports[`when applied with include option matches snapshot for multiple include values: included2.110cfb201ee67fa7a412.js 1`] = `"webpackJsonp([0],[,function(o,n){o.exports=function(){console.log(7)}}],[1]);"`;
178178

179-
exports[`when applied with include option matches snapshot for multiple includes: manifest.d37b2b873f771997c745.js 1`] = `
179+
exports[`when applied with include option matches snapshot for multiple include values: manifest.d37b2b873f771997c745.js 1`] = `
180180
"/******/ (function(modules) { // webpackBootstrap
181181
/******/ // install a JSONP callback for chunk loading
182182
/******/ var parentJsonpFunction = window[\\"webpackJsonp\\"];
@@ -280,4 +280,4 @@ exports[`when applied with include option matches snapshot for multiple includes
280280
/******/ ([]);"
281281
`;
282282

283-
exports[`when applied with include option matches snapshot for multiple includes: warnings 1`] = `Array []`;
283+
exports[`when applied with include option matches snapshot for multiple include values: warnings 1`] = `Array []`;

0 commit comments

Comments
 (0)