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

Commit

Permalink
refactor: tests (#334)
Browse files Browse the repository at this point in the history
* refactor: move `ecma` test to `uglifyOptions` test

* refactor: tests for `test`, `include` and `exclude` options

* refactor: `parallel` test

* refactor: merge `extractComments` option tests
  • Loading branch information
evilebottnawi committed Jul 30, 2018
1 parent 726874b commit 817f67e
Show file tree
Hide file tree
Showing 14 changed files with 1,162 additions and 1,008 deletions.
346 changes: 0 additions & 346 deletions test/__snapshots__/ecma.test.js.snap

This file was deleted.

24 changes: 12 additions & 12 deletions test/__snapshots__/exclude-option.test.js.snap
@@ -1,10 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

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]);"`;
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]);"`;

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

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

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]);"`;
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]);"`;

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}}([]);"`;
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}}([]);"`;

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

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]);"`;
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]);"`;

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

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

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

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}}([]);"`;
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}}([]);"`;

exports[`when applied with exclude option matches snapshot for multiple excludes: warnings 1`] = `Array []`;
exports[`when applied with exclude option matches snapshot for multiple exclude values: warnings 1`] = `Array []`;
24 changes: 12 additions & 12 deletions test/__snapshots__/include-option.test.js.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

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

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

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]);"`;
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]);"`;

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

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

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

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

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

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]);"`;
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]);"`;

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]);"`;
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]);"`;

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

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

0 comments on commit 817f67e

Please sign in to comment.