Browse Source

[build] Removed closure compiler

master
Muthu Kumar 6 years ago
parent
commit
6bb35af740
  1. 82
      es5/dist.js
  2. 443
      es5/index.js
  3. 5
      package.json
  4. 4
      scripts/closure.sh

82
es5/dist.js

@ -1,82 +0,0 @@
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.owns=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};$jscomp.assign="function"==typeof Object.assign?Object.assign:function(a,b){for(var h=1;h<arguments.length;h++){var e=arguments[h];if(e)for(var d in e)$jscomp.owns(e,d)&&(a[d]=e[d])}return a};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,h){a!=Array.prototype&&a!=Object.prototype&&(a[b]=h.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(a,b,h,e){if(b){h=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var d=a[e];d in h||(h[d]={});h=h[d]}a=a[a.length-1];e=h[a];b=b(e);b!=e&&null!=b&&$jscomp.defineProperty(h,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Object.assign",function(a){return a||$jscomp.assign},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
$jscomp.Symbol=function(){var a=0;return function(b){return $jscomp.SYMBOL_PREFIX+(b||"")+a++}}();$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.asyncIterator;a||(a=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.arrayIterator=function(a){var b=0;return $jscomp.iteratorPrototype(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};$jscomp.polyfill("Array.from",function(a){return a?a:function(a,h,e){$jscomp.initSymbolIterator();h=null!=h?h:function(c){return c};var b=[],m=a[Symbol.iterator];if("function"==typeof m){a=m.call(a);for(var c=0;!(m=a.next()).done;)b.push(h.call(e,m.value,c++))}else for(m=a.length,c=0;c<m;c++)b.push(h.call(e,a[c],c));return b}},"es6","es3");
$jscomp.iteratorFromArray=function(a,b){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var h=0,e={next:function(){if(h<a.length){var d=h++;return{value:b(d,a[d]),done:!1}}e.next=function(){return{done:!0,value:void 0}};return e.next()}};e[Symbol.iterator]=function(){return e};return e};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6","es3");
$jscomp.makeIterator=function(a){$jscomp.initSymbolIterator();var b=a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(a){function b(){this.batch_=null}function h(c){return c instanceof d?c:new d(function(a,l){a(c)})}if(a&&!$jscomp.FORCE_POLYFILL_PROMISE)return a;b.prototype.asyncExecute=function(c){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(c);return this};b.prototype.asyncExecuteBatch_=function(){var c=this;this.asyncExecuteFunction(function(){c.executeBatch_()})};var e=$jscomp.global.setTimeout;b.prototype.asyncExecuteFunction=function(c){e(c,
0)};b.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var c=this.batch_;this.batch_=[];for(var a=0;a<c.length;++a){var l=c[a];c[a]=null;try{l()}catch(f){this.asyncThrow_(f)}}}this.batch_=null};b.prototype.asyncThrow_=function(c){this.asyncExecuteFunction(function(){throw c;})};var d=function(c){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var a=this.createResolveAndReject_();try{c(a.resolve,a.reject)}catch(l){a.reject(l)}};d.prototype.createResolveAndReject_=
function(){function c(c){return function(f){l||(l=!0,c.call(a,f))}}var a=this,l=!1;return{resolve:c(this.resolveTo_),reject:c(this.reject_)}};d.prototype.resolveTo_=function(c){if(c===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(c instanceof d)this.settleSameAsPromise_(c);else{a:switch(typeof c){case "object":var a=null!=c;break a;case "function":a=!0;break a;default:a=!1}a?this.resolveToNonPromiseObj_(c):this.fulfill_(c)}};d.prototype.resolveToNonPromiseObj_=function(a){var c=
void 0;try{c=a.then}catch(l){this.reject_(l);return}"function"==typeof c?this.settleSameAsThenable_(c,a):this.fulfill_(a)};d.prototype.reject_=function(a){this.settle_(2,a)};d.prototype.fulfill_=function(a){this.settle_(1,a)};d.prototype.settle_=function(a,b){if(0!=this.state_)throw Error("Cannot settle("+a+", "+b+"): Promise already settled in state"+this.state_);this.state_=a;this.result_=b;this.executeOnSettledCallbacks_()};d.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var a=
0;a<this.onSettledCallbacks_.length;++a)m.asyncExecute(this.onSettledCallbacks_[a]);this.onSettledCallbacks_=null}};var m=new b;d.prototype.settleSameAsPromise_=function(a){var c=this.createResolveAndReject_();a.callWhenSettled_(c.resolve,c.reject)};d.prototype.settleSameAsThenable_=function(a,b){var c=this.createResolveAndReject_();try{a.call(b,c.resolve,c.reject)}catch(f){c.reject(f)}};d.prototype.then=function(a,b){function c(a,c){return"function"==typeof a?function(c){try{f(a(c))}catch(q){k(q)}}:
c}var f,k,g=new d(function(a,c){f=a;k=c});this.callWhenSettled_(c(a,f),c(b,k));return g};d.prototype.catch=function(a){return this.then(void 0,a)};d.prototype.callWhenSettled_=function(a,b){function c(){switch(f.state_){case 1:a(f.result_);break;case 2:b(f.result_);break;default:throw Error("Unexpected state: "+f.state_);}}var f=this;null==this.onSettledCallbacks_?m.asyncExecute(c):this.onSettledCallbacks_.push(c)};d.resolve=h;d.reject=function(a){return new d(function(c,b){b(a)})};d.race=function(a){return new d(function(c,
b){for(var f=$jscomp.makeIterator(a),l=f.next();!l.done;l=f.next())h(l.value).callWhenSettled_(c,b)})};d.all=function(a){var c=$jscomp.makeIterator(a),b=c.next();return b.done?h([]):new d(function(a,l){function f(c){return function(f){k[c]=f;g--;0==g&&a(k)}}var k=[],g=0;do k.push(void 0),g++,h(b.value).callWhenSettled_(f(k.length-1),l),b=c.next();while(!b.done)})};return d},"es6","es3");$jscomp.polyfill("Object.getOwnPropertySymbols",function(a){return a?a:function(){return[]}},"es6","es5");
$jscomp.polyfill("Reflect.ownKeys",function(a){return a?a:function(a){var b=[],e=Object.getOwnPropertyNames(a);a=Object.getOwnPropertySymbols(a);for(var d=0;d<e.length;d++)("jscomp_symbol_"==e[d].substring(0,14)?a:b).push(e[d]);return b.concat(a)}},"es6","es5");$jscomp.findInternal=function(a,b,h){a instanceof String&&(a=String(a));for(var e=a.length,d=0;d<e;d++){var m=a[d];if(b.call(h,m,d,a))return{i:d,v:m}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,h){return $jscomp.findInternal(this,a,h).v}},"es6","es3");$jscomp.polyfill("Array.prototype.findIndex",function(a){return a?a:function(a,h){return $jscomp.findInternal(this,a,h).i}},"es6","es3");
var _slicedToArray=function(){return function(a,b){if(Array.isArray(a))return a;if(Symbol.iterator in Object(a)){var h=[],e=!0,d=!1,m=void 0;try{for(var c=a[Symbol.iterator](),g;!(e=(g=c.next()).done)&&(h.push(g.value),!b||h.length!==b);e=!0);}catch(l){d=!0,m=l}finally{try{if(!e&&c["return"])c["return"]()}finally{if(d)throw m;}}return h}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),_createClass=function(){function a(a,h){for(var b=0;b<h.length;b++){var d=h[b];d.enumerable=
d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,h,e){h&&a(b.prototype,h);e&&a(b,e);return b}}(),_extends2=Object.assign||function(a){for(var b=1;b<arguments.length;b++){var h=arguments[b],e;for(e in h)Object.prototype.hasOwnProperty.call(h,e)&&(a[e]=h[e])}return a},_typeof2="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&
a!==Symbol.prototype?"symbol":typeof a},_templateObject=_taggedTemplateLiteral([""," is not an array"],[""," is not an array"]),_templateObject2=_taggedTemplateLiteral([""," is not an object"],[""," is not an object"]),_templateObject3=_taggedTemplateLiteral([""," doesn't have length ",""],[""," doesn't have length ",""]),_templateObject4=_taggedTemplateLiteral([""," is not equal to ",""],[""," is not equal to ",""]),_templateObject5=_taggedTemplateLiteral([""," is not deeply equal to ",""],[""," is not deeply equal to ",
""]),_templateObject6=_taggedTemplateLiteral([""," does not contain ",""],[""," does not contain ",""]),_templateObject7=_taggedTemplateLiteral([""," is not true"],[""," is not true"]),_templateObject8=_taggedTemplateLiteral([""," is not false"],[""," is not false"]),_templateObject9=_taggedTemplateLiteral([""," does not have property '","'"],[""," does not have property '","'"]),_templateObject10=_taggedTemplateLiteral([""," does not exist in ",""],[""," does not exist in ",""]),_templateObject11=
_taggedTemplateLiteral([""," is not a promise"],[""," is not a promise"]),_templateObject12=_taggedTemplateLiteral(["'","' does not resolve to '","'"],["'","' does not resolve to '","'"]),_templateObject13=_taggedTemplateLiteral(["'","' is not of type '","'"],["'","' is not of type '","'"]),_templateObject14=_taggedTemplateLiteral(["'","' is not greater than ",""],["'","' is not greater than ",""]),_templateObject15=_taggedTemplateLiteral(["'","' is not less than ",""],["'","' is not less than ",
""]),_templateObject16=_taggedTemplateLiteral(["'","' is less than ",""],["'","' is less than ",""]),_templateObject17=_taggedTemplateLiteral(["'","' is greater than ",""],["'","' is greater than ",""]);function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==typeof b&&"function"!==typeof b?a:b}
function _inherits(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function _taggedTemplateLiteral(a,b){return Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(b)}}))}
function _toArray(a){return Array.isArray(a)?a:Array.from(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function _defineProperty2(a,b,h){b in a?Object.defineProperty(a,b,{value:h,enumerable:!0,configurable:!0,writable:!0}):a[b]=h;return a}function _toConsumableArray2(a){if(Array.isArray(a)){for(var b=0,h=Array(a.length);b<a.length;b++)h[b]=a[b];return h}return Array.from(a)}
(function(a){"object"===("undefined"===typeof exports?"undefined":_typeof2(exports))&&"undefined"!==typeof module?module.exports=a():"function"===typeof define&&define.amd?define([],a):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).Gunner=a()})(function(){return function(){function a(b,h,e){function d(c,l){if(!h[c]){if(!b[c]){var f="function"==typeof require&&require;if(!l&&f)return f(c,!0);if(m)return m(c,!0);l=Error("Cannot find module '"+
c+"'");throw l.code="MODULE_NOT_FOUND",l;}l=h[c]={exports:{}};b[c][0].call(l.exports,function(a){return d(b[c][1][a]||a)},l,l.exports,a,b,h,e)}return h[c].exports}for(var m="function"==typeof require&&require,c=0;c<e.length;c++)d(e[c]);return d}return a}()({1:[function(a,b,h){b.exports=a("../src/gunner")},{"../src/gunner":9}],2:[function(a,b,h){(function(e){(function(a){"object"===("undefined"===typeof h?"undefined":_typeof2(h))&&"undefined"!==typeof b?b.exports=a():("undefined"!==typeof window?window:
"undefined"!==typeof e?e:"undefined"!==typeof self?self:this).isEq=a()})(function(){return function(){function b(d,c,g){function l(k,e){if(!c[k]){if(!d[k]){var m="function"==typeof a&&a;if(!e&&m)return m(k,!0);if(f)return f(k,!0);e=Error("Cannot find module '"+k+"'");throw e.code="MODULE_NOT_FOUND",e;}e=c[k]={exports:{}};d[k][0].call(e.exports,function(a){var c=d[k][1][a];return l(c?c:a)},e,e.exports,b,d,c,g)}return c[k].exports}for(var f="function"==typeof a&&a,k=0;k<g.length;k++)l(g[k]);return l}
return b}()({1:[function(a,b,c){var g="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(a){return"undefined"===typeof a?"undefined":_typeof2(a)}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":"undefined"===typeof a?"undefined":_typeof2(a)};b.exports=function n(a,c,b){if(a===c)return!0;if(("undefined"===typeof a?"undefined":g(a))!==("undefined"===typeof c?"undefined":g(c))||Array.isArray(a)&&!Array.isArray(c)||Array.isArray(c)&&
!Array.isArray(a))return!1;if("number"===typeof a)return isNaN(a)&&isNaN(c)?!1:a===c;if("string"===typeof a||"boolean"===typeof a||null===a||void 0===a)return a===c;if(a instanceof RegExp)return String(a)===String(c);if("object"!==("undefined"===typeof a?"undefined":g(a))||"object"!==("undefined"===typeof c?"undefined":g(c)))return a===c;var f=Object.keys(a),k=Object.keys(c);if(!b&&(b=f,f.length!==k.length))return!1;if(!Array.isArray(b))throw Error("[isEq] third parameter should be an array of keys!");
if(0===b.length)return!0;for(var d in b)if(f=b[d],Array.isArray(a[f])&&Array.isArray(c[f])&&(f=d),a[f]!==c[f])if(g("object"===a[f])&&g("object"===c[f])||Array.isArray(a[f])&&Array.isArray(c[f])){if(!n(a[f],c[f]))return!1}else return!1;return!0}},{}]},{},[1])(1)})}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],3:[function(a,b,h){(function(e){function d(a,c,b){c in a?Object.defineProperty(a,c,{value:b,enumerable:!0,configurable:!0,
writable:!0}):a[c]=b;return a}function m(a){if(Array.isArray(a)){for(var c=0,b=Array(a.length);c<a.length;c++)b[c]=a[c];return b}return Array.from(a)}var c=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var b=arguments[c],g;for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(a[g]=b[g])}return a},g="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(a){return"undefined"===typeof a?"undefined":_typeof2(a)}:function(a){return a&&"function"===typeof Symbol&&a.constructor===
Symbol&&a!==Symbol.prototype?"symbol":"undefined"===typeof a?"undefined":_typeof2(a)};(function(a){"object"===("undefined"===typeof h?"undefined":g(h))&&"undefined"!==typeof b?b.exports=a():("undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:this).promiseObject=a()})(function(){return function(){function c(b,g,d){function f(e,l){if(!g[e]){if(!b[e]){var m="function"==typeof a&&a;if(!l&&m)return m(e,!0);if(k)return k(e,!0);l=Error("Cannot find module '"+e+"'");
throw l.code="MODULE_NOT_FOUND",l;}l=g[e]={exports:{}};b[e][0].call(l.exports,function(a){return f(b[e][1][a]||a)},l,l.exports,c,b,g,d)}return g[e].exports}for(var k="function"==typeof a&&a,e=0;e<d.length;e++)f(d[e]);return f}return c}()({1:[function(a,c,b){c.exports=a("../index.js")},{"../index.js":2}],2:[function(a,b,e){var f=function(a){return a&&"object"===("undefined"===typeof a?"undefined":g(a))&&a.constructor===Object},l="undefined"!==typeof Symbol?Symbol("SELF"):"[~~//-- SELF --//~~]",k=function(a,
c){return function w(b){return Object.keys(b).reduce(function(g,e){var d=b[e];return d===c?(b[e]=a,[].concat(m(g),[e])):f(d)?[].concat(m(g),m(w(d,c))):g},[])}(a)},h=function(a,c){return Promise.all(a.map(function(a){return Promise.resolve(a).then(c)}))},q=function(a){return Promise.all(Object.keys(a).map(function(c){return Promise.resolve(a[c]).then(function(b){return a[c]=b})})).then(function(c){return a})};b.exports=function(a){var b=!1;return function w(g){return Promise.resolve(g).then(function(g){return Array.isArray(g)?
h(g,function(a){return w(a)}):f(g)?q(Object.keys(g).reduce(function(f,e){return g[e]===a?(b=!0,c({},f,d({},e,l))):c({},f,d({},e,w(g[e])))},{})):g})}(a).then(function(a){b&&k(a,l);return a})}},{}]},{},[1])(1)})}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"../index.js":4}],4:[function(a,b,h){var e=function(a){return a&&"object"===("undefined"===typeof a?"undefined":_typeof2(a))&&a.constructor===Object},d="undefined"!==typeof Symbol?
Symbol("SELF"):"[~~//-- SELF --//~~]",m=function(a,c){return function n(b){return Object.keys(b).reduce(function(f,g){var d=b[g];return d===c?(b[g]=a,[].concat(_toConsumableArray2(f),[g])):e(d)?[].concat(_toConsumableArray2(f),_toConsumableArray2(n(d,c))):f},[])}(a)},c=function(a,c){return Promise.all(a.map(function(a){return Promise.resolve(a).then(c)}))},g=function(a){return Promise.all(Object.keys(a).map(function(c){return Promise.resolve(a[c]).then(function(b){return a[c]=b})})).then(function(c){return a})};
b.exports=function(a){var b=!1;return function n(f){return Promise.resolve(f).then(function(f){return Array.isArray(f)?c(f,function(a){return n(a)}):e(f)?g(Object.keys(f).reduce(function(c,g){return f[g]===a?(b=!0,_extends2({},c,_defineProperty2({},g,d))):_extends2({},c,_defineProperty2({},g,n(f[g])))},{})):f})}(a).then(function(a){b&&m(a,d);return a})}},{}],5:[function(a,b,h){},{}],6:[function(a,b,h){function e(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=p(null),
this._eventsCount=0);this._maxListeners=this._maxListeners||void 0}function d(a,c,b,f){var g;if("function"!==typeof b)throw new TypeError('"listener" argument must be a function');if(g=a._events){g.newListener&&(a.emit("newListener",c,b.listener?b.listener:b),g=a._events);var d=g[c]}else g=a._events=p(null),a._eventsCount=0;d?("function"===typeof d?d=g[c]=f?[b,d]:[d,b]:f?d.unshift(b):d.push(b),d.warned||(b=void 0===a._maxListeners?e.defaultMaxListeners:a._maxListeners)&&0<b&&d.length>b&&(d.warned=
!0,b=Error("Possible EventEmitter memory leak detected. "+d.length+' "'+String(c)+'" listeners added. Use emitter.setMaxListeners() to increase limit.'),b.name="MaxListenersExceededWarning",b.emitter=a,b.type=c,b.count=d.length,"object"===("undefined"===typeof console?"undefined":_typeof2(console))&&console.warn&&console.warn("%s: %s",b.name,b.message))):(g[c]=b,++a._eventsCount);return a}function m(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);
case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var a=Array(arguments.length),c=0;c<a.length;++c)a[c]=arguments[c];this.listener.apply(this.target,a)}}function c(a,c,b){a={fired:!1,wrapFn:void 0,target:a,type:c,listener:b};c=q.call(m,a);c.listener=b;return a.wrapFn=c}function g(a,c,b){a=a._events;if(!a)return[];c=a[c];if(!c)return[];
if("function"===typeof c)return b?[c.listener||c]:[c];if(b)for(b=Array(c.length),a=0;a<b.length;++a)b[a]=c[a].listener||c[a];else b=f(c,c.length);return b}function l(a){var c=this._events;if(c){a=c[a];if("function"===typeof a)return 1;if(a)return a.length}return 0}function f(a,c){for(var b=Array(c),f=0;f<c;++f)b[f]=a[f];return b}function k(a){var c=function(){};c.prototype=a;return new c}function r(a){var c=[],b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&c.push(b);return b}function n(a){var c=
this;return function(){return c.apply(a,arguments)}}var p=Object.create||k,t=Object.keys||r,q=Function.prototype.bind||n;b.exports=e;e.EventEmitter=e;e.prototype._events=void 0;e.prototype._maxListeners=void 0;var u=10;try{a={};Object.defineProperty&&Object.defineProperty(a,"x",{value:0});var v=0===a.x}catch(x){v=!1}v?Object.defineProperty(e,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(a){if("number"!==typeof a||0>a||a!==a)throw new TypeError('"defaultMaxListeners" must be a positive number');
u=a}}):e.defaultMaxListeners=u;e.prototype.setMaxListeners=function(a){if("number"!==typeof a||0>a||isNaN(a))throw new TypeError('"n" argument must be a positive number');this._maxListeners=a;return this};e.prototype.getMaxListeners=function(){return void 0===this._maxListeners?e.defaultMaxListeners:this._maxListeners};e.prototype.emit=function(a){var c,b,g;var d="error"===a;if(g=this._events)d=d&&null==g.error;else if(!d)return!1;if(d){1<arguments.length&&(c=arguments[1]);if(c instanceof Error)throw c;
g=Error('Unhandled "error" event. ('+c+")");g.context=c;throw g;}c=g[a];if(!c)return!1;g="function"===typeof c;var e=arguments.length;switch(e){case 1:if(g)c.call(this);else for(g=c.length,c=f(c,g),d=0;d<g;++d)c[d].call(this);break;case 2:d=arguments[1];if(g)c.call(this,d);else for(g=c.length,c=f(c,g),e=0;e<g;++e)c[e].call(this,d);break;case 3:d=arguments[1];e=arguments[2];if(g)c.call(this,d,e);else for(g=c.length,c=f(c,g),b=0;b<g;++b)c[b].call(this,d,e);break;case 4:d=arguments[1];e=arguments[2];
b=arguments[3];if(g)c.call(this,d,e,b);else{g=c.length;c=f(c,g);for(var k=0;k<g;++k)c[k].call(this,d,e,b)}break;default:d=Array(e-1);for(b=1;b<e;b++)d[b-1]=arguments[b];if(g)c.apply(this,d);else for(g=c.length,c=f(c,g),e=0;e<g;++e)c[e].apply(this,d)}return!0};e.prototype.addListener=function(a,c){return d(this,a,c,!1)};e.prototype.on=e.prototype.addListener;e.prototype.prependListener=function(a,c){return d(this,a,c,!0)};e.prototype.once=function(a,b){if("function"!==typeof b)throw new TypeError('"listener" argument must be a function');
this.on(a,c(this,a,b));return this};e.prototype.prependOnceListener=function(a,b){if("function"!==typeof b)throw new TypeError('"listener" argument must be a function');this.prependListener(a,c(this,a,b));return this};e.prototype.removeListener=function(a,c){var b;if("function"!==typeof c)throw new TypeError('"listener" argument must be a function');var g=this._events;if(!g)return this;var f=g[a];if(!f)return this;if(f===c||f.listener===c)0===--this._eventsCount?this._events=p(null):(delete g[a],
g.removeListener&&this.emit("removeListener",a,f.listener||c));else if("function"!==typeof f){var d=-1;for(b=f.length-1;0<=b;b--)if(f[b]===c||f[b].listener===c){var e=f[b].listener;d=b;break}if(0>d)return this;if(0===d)f.shift();else{b=d+1;for(var k=f.length;b<k;d+=1,b+=1)f[d]=f[b];f.pop()}1===f.length&&(g[a]=f[0]);g.removeListener&&this.emit("removeListener",a,e||c)}return this};e.prototype.removeAllListeners=function(a){var c=this._events;if(!c)return this;if(!c.removeListener)return 0===arguments.length?
(this._events=p(null),this._eventsCount=0):c[a]&&(0===--this._eventsCount?this._events=p(null):delete c[a]),this;if(0===arguments.length){var b=t(c);for(c=0;c<b.length;++c){var g=b[c];"removeListener"!==g&&this.removeAllListeners(g)}this.removeAllListeners("removeListener");this._events=p(null);this._eventsCount=0;return this}b=c[a];if("function"===typeof b)this.removeListener(a,b);else if(b)for(c=b.length-1;0<=c;c--)this.removeListener(a,b[c]);return this};e.prototype.listeners=function(a){return g(this,
a,!0)};e.prototype.rawListeners=function(a){return g(this,a,!1)};e.listenerCount=function(a,c){return"function"===typeof a.listenerCount?a.listenerCount(c):l.call(a,c)};e.prototype.listenerCount=l;e.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]}},{}],7:[function(a,b,h){function e(a,b){var c=[],g=[];null==b&&(b=function(a,b){return c[0]===b?"[Circular ~]":"[Circular ~."+g.slice(0,c.indexOf(b)).join(".")+"]"});return function(d,f){if(0<c.length){var e=c.indexOf(this);
~e?c.splice(e+1):c.push(this);~e?g.splice(e,Infinity,d):g.push(d);~c.indexOf(f)&&(f=b.call(this,d,f))}else c.push(f);return null==a?f:a.call(this,d,f)}}h=b.exports=function(a,b,c,g){return JSON.stringify(a,e(b,g),c)};h.getSerialize=e},{}],8:[function(a,b,h){function e(){throw Error("setTimeout has not been defined");}function d(){throw Error("clearTimeout has not been defined");}function m(a){if(r===setTimeout)return setTimeout(a,0);if((r===e||!r)&&setTimeout)return r=setTimeout,setTimeout(a,0);try{return r(a,
0)}catch(x){try{return r.call(null,a,0)}catch(y){return r.call(this,a,0)}}}function c(a){if(n===clearTimeout)return clearTimeout(a);if((n===d||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(a);try{return n(a)}catch(x){try{return n.call(null,a)}catch(y){return n.call(this,a)}}}function g(){t&&q&&(t=!1,q.length?p=q.concat(p):u=-1,p.length&&l())}function l(){if(!t){var a=m(g);t=!0;for(var b=p.length;b;){q=p;for(p=[];++u<b;)q&&q[u].run();u=-1;b=p.length}q=null;t=!1;c(a)}}function f(a,c){this.fun=
a;this.array=c}function k(){}a=b.exports={};try{var r="function"===typeof setTimeout?setTimeout:e}catch(v){r=e}try{var n="function"===typeof clearTimeout?clearTimeout:d}catch(v){n=d}var p=[],t=!1,q,u=-1;a.nextTick=function(a){var c=Array(arguments.length-1);if(1<arguments.length)for(var b=1;b<arguments.length;b++)c[b-1]=arguments[b];p.push(new f(a,c));1!==p.length||t||m(l)};f.prototype.run=function(){this.fun.apply(null,this.array)};a.title="browser";a.browser=!0;a.env={};a.argv=[];a.version="";a.versions=
{};a.on=k;a.addListener=k;a.once=k;a.off=k;a.removeListener=k;a.removeAllListeners=k;a.emit=k;a.prependListener=k;a.prependOnceListener=k;a.listeners=function(a){return[]};a.binding=function(a){throw Error("process.binding is not supported");};a.cwd=function(){return"/"};a.chdir=function(a){throw Error("process.chdir is not supported");};a.umask=function(){return 0}},{}],9:[function(a,b,h){(function(e){var d=a("./util").arrayOrPush,m=a("./lib/caller"),c=a("./lib/emitter"),g=a("./reporters"),l=a("./lib/testrunner"),
f=a("./lib/expect"),k=a("./util/symbols"),h=function(){function a(c){var b,g;_classCallCheck(this,a);this.name=c;this.__suite__={tests:[],beforeHooks:(b={},_defineProperty2(b,k.Start,[]),_defineProperty2(b,k.End,[]),_defineProperty2(b,"*",[]),b),afterHooks:(g={},_defineProperty2(g,k.Start,[]),_defineProperty2(g,k.End,[]),_defineProperty2(g,"*",[]),g)}}_createClass(a,[{key:"test",value:function(a,c){if(this.__suite__.tests.find(function(c){return c.description===a}))throw Error("Test '"+a+"' already exists!");
this.__suite__.tests.push({description:a,type:"test",run:function(a){return m(c,a)}});return this}},{key:"before",value:function(a,c,b){d(this.__suite__.beforeHooks,a,{description:a,label:b,type:"hook",run:function(a){return m(c,a)}});return this}},{key:"after",value:function(a,c,b){d(this.__suite__.afterHooks,a,{description:a,label:b,type:"hook",run:function(a){return m(c,a)}});return this}},{key:"run",value:function(){var a=this,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(!0===
b.reporter)g.default(c,b);else if("function"===typeof b.reporter)b.reporter(c,b);else if(g[b.reporter])g[b.reporter](c,b);c.emit("start");return l(this,b).then(function(f){var d;f.count=f.length;f.success=f.filter(function(a){return"ok"===a.status});f.failures=f.filter(function(a){return"notOk"===a.status});f.skipped=f.filter(function(a){return"skip"===a.status});f.successPercent=Math.floor(f.success.length/f.length*100);f.name=a.name;100!==f.successPercent&&"undefined"!==typeof e&&(e.exitCode=1);
c.emit("test end",f);c.emit("end",f);return b.request?(d={},_defineProperty2(d,b.request,g[b.request].convert(f)),_defineProperty2(d,"json",f),d):f})}}]);return a}();b.exports=h;b.exports.expect=f;b.exports.expectMany=f.expectMany;b.exports.Start=k.Start;b.exports.End=k.End;b.exports.Gunner=b.exports}).call(this,a("_process"))},{"./lib/caller":13,"./lib/emitter":14,"./lib/expect":15,"./lib/testrunner":16,"./reporters":18,"./util":21,"./util/symbols":22,_process:8}],10:[function(a,b,h){var e=a("../util").isPromise,
d=function(a){for(var c=arguments.length,b=Array(1<c?c-1:0),d=1;d<c;d++)b[d-1]=arguments[d];return Promise.reject(a?a.apply(void 0,b):"")};b.exports=function(a,c){var b=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},l=_toArray(c),f=l[0],k=l.slice(1);f=b.skipStatement?function(){return b.skipStatement}:f;return e(a)?a.catch(function(){return d.apply(void 0,[f].concat(_toConsumableArray2(k)))}):a?Promise.resolve():d.apply(void 0,[f].concat(_toConsumableArray2(k)))}},{"../util":21}],11:[function(a,
b,h){var e=a("@codefeathers/iseq"),d=a("../util"),m=d.taggedStringify;b.exports.done=[function(){return!0},function(){return null}];b.exports.fail=[function(){return!1},function(a,b){return b}];b.exports.exists=[function(a){return"undefined"!==typeof a},function(){return"Value is undefined"}];b.exports.isArray=[function(a){return Array.isArray(a)},function(a){return m(_templateObject,a)}];b.exports.isObject=[function(a){return"object"===("undefined"===typeof a?"undefined":_typeof2(a))&&null!==a},
function(a){return m(_templateObject2,a)}];b.exports.hasLength=[function(a,b){return a.length===b},function(a,b){return m(_templateObject3,a,b)}];b.exports.equals=[function(a,b){return a===b},function(a,b){return m(_templateObject4,a,b)}];b.exports.deepEquals=[function(a,b){return e(a,b)},function(a,b){return m(_templateObject5,a,b)}];b.exports.contains=[function(a,b){return e(a,b,Object.keys(b))},function(a,b){return m(_templateObject6,a,b)}];b.exports.isTrue=[function(a){return!0===a},function(a){return m(_templateObject7,
a)}];b.exports.isFalse=[function(a){return!1===a},function(a){return m(_templateObject8,a)}];b.exports.hasProp=[function(a,b){return a.hasOwnProperty(b)},function(a,b){return m(_templateObject9,a,b)}];b.exports.hasPair=[function(a){for(var c=arguments.length,b=Array(1<c?c-1:0),f=1;f<c;f++)b[f-1]=arguments[f];return e(a[b[0]],b[1])},function(a){for(var c=arguments.length,b=Array(1<c?c-1:0),f=1;f<c;f++)b[f-1]=arguments[f];return m(_templateObject10,b,a)}];b.exports.isPromise=[function(a){return d.isPromise(a)},
function(a){return m(_templateObject11,a)},{shouldCatch:!0}];b.exports.resolvesTo=[function(a,b){return d.isPromise(a)?a.then(function(a){return a===b?Promise.resolve():Promise.reject()}):Promise.reject(a+" was not a Promise")},function(a,b){return m(_templateObject12,a,b)}];b.exports.isType=[function(a,b){return"nil"===b&&("null"===a||"undefined"===a)||("undefined"===typeof a?"undefined":_typeof2(a))===b||Array.isArray(a)&&"array"===b&&null===a&&"object"!==b},function(a,b){return m(_templateObject13,
a,b)}];b.exports.greaterThan=[function(a,b){return a>b},function(a,b){return m(_templateObject14,a,b)}];b.exports.lessThan=[function(a,b){return a<b},function(a,b){return m(_templateObject15,a,b)}];b.exports.gte=[function(a,b){return a>=b},function(a,b){return m(_templateObject16,a,b)}];b.exports.lte=[function(a,b){return a<=b},function(a,b){return m(_templateObject17,a,b)}];b.exports.success=b.exports.done;b.exports.succeed=b.exports.done;b.exports.failure=b.exports.fail;b.exports.equal=b.exports.equals;
b.exports.deepEqual=b.exports.deepEquals;b.exports.match=b.exports.deepEquals;b.exports.greaterThanOrEqualTo=b.exports.gte;b.exports.lessThanOrEqualTo=b.exports.lte},{"../util":21,"@codefeathers/iseq":2}],12:[function(a,b,h){a("../gunner");var e=a("../util/symbols"),d=function(a){return function(b){return{type:a,unit:b}}};b.exports=function(a){var b=[];Array.prototype.push.apply(b,a.__suite__.beforeHooks[e.Start].map(d("@start")));b.push.apply(a.__suite__.afterHooks[e.Start].map(d("@start")));a.__suite__.tests.forEach(function(c){return Array.prototype.push.apply(b,
a.__suite__.beforeHooks["*"].map(d("@every"))),Array.prototype.push.apply(b,(a.__suite__.beforeHooks[c.description]||[]).map(d("@this"))),b.push(d("@test")(c)),Array.prototype.push.apply(b,(a.__suite__.afterHooks[c.description]||[]).map(d("@afterTest"))),Array.prototype.push.apply(b,a.__suite__.afterHooks["*"].map(d("@afterEvery")))});Array.prototype.push.apply(b,a.__suite__.beforeHooks[e.End].map(d("@beforeend")));Array.prototype.push.apply(b,a.__suite__.afterHooks[e.End].map(d("@end")));return b}},
{"../gunner":9,"../util/symbols":22}],13:[function(a,b,h){var e=a("../util").isPromise;b.exports=function(a,b){var c=0,d=0,l=void 0,f=void 0,k=void 0;try{c=Date.now(),l=a(b),d=Date.now()}catch(r){d=Date.now(),k=!0,f=r}return e(l)?l.then(function(a){return{duration:Date.now()-c,status:"ok",resolve:a,promise:!0}}).catch(function(a){return{duration:Date.now()-c,status:"notOk",rejection:a,promise:!0}}):Promise.resolve(_extends2({duration:d-c,status:k?"notOk":"ok"},!k&&{value:l},k&&{error:f},{promise:!1}))}},
{"../util":21}],14:[function(a,b,h){a=function(a){function b(){_classCallCheck(this,b);return _possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}_inherits(b,a);return b}(a("events"));b.exports=new a},{events:6}],15:[function(a,b,h){h=a("../util");var e=h.liftPromise,d=h.lowerCaseFirstLetter,m=a("./assertionsLibrary"),c=a("./assertPromise"),g=function(a,b){var f=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return function(d){return function(){for(var g=
arguments.length,k=Array(g),l=0;l<g;l++)k[l]=arguments[l];return e(function(f){return c(a.apply(void 0,[d].concat(k)),[b,f].concat(k))},d).catch(function(e){return f.shouldCatch?c(a.apply(void 0,[d].concat(k)),[b,e].concat(k),{skipStatement:e}):Promise.reject(e)})}}},l=Object.keys(m).reduce(function(a,b){var c=_slicedToArray(m[b],3);a[b]=g(c[0],c[1],c[2]);return a},{});b.exports=function(a,b){return new Proxy({},{get:function(c,f){var e=b?a.apply(void 0,_toConsumableArray2(b)):a;if(l.hasOwnProperty(f))return function(){return l[f](e).apply(void 0,
arguments)};if("not"===f.slice(0,3))return function(){return l[d(f.slice(3))](e).apply(void 0,arguments).then(Promise.reject,Promise.resolve)};throw Error("Unknown assertion method",f);}})};b.exports.expectMany=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return Promise.all(b)}},{"../util":21,"./assertPromise":10,"./assertionsLibrary":11}],16:[function(a,b,h){a("../gunner");Promise.object=a("@codefeathers/promise.object");a("perf_hooks");h=a("../util");var e=h.last,
d=h.pipe,m=h.pick,c=h.assignToObject,g=a("./buildTestQueue"),l=function(a,b){var c=a.findIndex(function(a){return"@start"===a.type}),f=a.findIndex(function(a){return"@every"===a.type}),d=a.findIndex(function(a){return a.description===b.description});return-1!==c&&"A start hook failed\n"+a[c].error||-1!==f&&"An every hook failed\n"+a[f].error||-1!==d&&"A before test hook failed\n"+a[d].error},f=function(a){return a.reduce(function(b,f){return Promise.resolve(b).then(function(b){return Promise.all([e(b.results),
Promise.object(b.state)]).then(function(a){a=_slicedToArray(a,2)[1];return[l(b.skip,f.unit),a]}).then(function(a){var b=_slicedToArray(a,2);a=b[0];b=b[1];return a?{status:"skip",description:a}:f.unit.run(b)}).then(function(d){var e=d.status,g=d.duration;if("@test"===f.type)g=_extends2({status:e,duration:g,description:f.unit.description},("notOk"===e||"skip"===e)&&{reason:d.error||d.rejection||d.description}),b.results.push(g);else{g=f.unit.label||a.filter(function(a){return a.type===f.type}).filter(function(a){return a.unit.description===
f.unit.description}).length;var k="ok"===e?d.promise?d.resolve:d.value:null;g&&k&&c(b.state,f.type)(g,k)}"notOk"===e&&b.skip.push({type:f.type,description:f.unit.description,error:d.promise?d.rejection:d.error});return b})})},{results:[],state:{},skip:[]})};b.exports=function(a){var b=Date.now();return Promise.object(d(g,f,m("results"))(a)).then(function(a){a.duration=Date.now()-b;return a})}},{"../gunner":9,"../util":21,"./buildTestQueue":12,"@codefeathers/promise.object":3,perf_hooks:5}],17:[function(a,
b,h){var e={ok:["ok","\u2705"],notOk:["notOk","\u274c"],skip:["skip","\u26a0\ufe0f"]};b.exports=function(a,b){a.on("start",function(){return console.log("Started tests")});a.on("test end",function(a){a.forEach(function(a){var c=e[a.status];console.log(">",c[0],c[1],a.description);b.trace&&a.reason&&console.log("\n---\n\n",a.reason,"\n\n---\n")})});a.on("end",function(a){console.log(a.success.length,"tests of",a.length,"passed");console.log("Success ratio:",a.successPercent,"%")})};b.exports.convert=
function(a){return a}},{}],18:[function(a,b,h){b.exports={default:a("./default"),tap:a("./tap"),xunit:a("./xunit")}},{"./default":17,"./tap":19,"./xunit":20}],19:[function(a,b,h){var e={ok:"ok",notOk:"not ok",skip:"skip"},d=function(a,b){return"\nTAP version 13\n"+(a.length?"1":0)+".."+a.length+"\n"+a.map(function(a,c){var f=b.trace&&a.reason&&(a.reason.stack?a.reason.stack:a.reason)||"";return e[a.status]+" "+(c+1)+" - "+a.description+(f&&"\n ---\n message: |\n "+f+"\n ---\n")}).join("\n")+
"\n"};b.exports=function(a,b){a.on("end",function(a){return console.log(d(a,b))})};b.exports.convert=d},{}],20:[function(a,b,h){var e=function(a,b,d,e){d=d?"/>":">";var c=[],g=void 0;Object.keys(b).forEach(function(a){Object.prototype.hasOwnProperty.call(b,a)&&c.push(a+'="'+b[a]+'"')});g="<"+a+(c.length?" "+c.join(" "):"")+d;e&&(g+=e+"</"+a+d);return new String(g)},d=function(a){return'<?xml version="1.0"?>'+e("testsuites",{},!1,e("testsuite",{name:a.name,tests:a.count,success:a.success.length,failures:a.failures.length,
skipped:a.skipped.length,timestamp:(new Date).toUTCString(),time:a.duration/1E3||0},!1,a.reduce(function(a,b){var c="ok"===b.status,f="ok"!==b.status&&("skip"===b.status?e("skipped",{},!0):e("failure",{},!b.reason,b.reason?b.reason:""));return a+=e("testcase",{name:b.description,time:b.duration/1E3||0},c,f||"")},"")))};b.exports=function(a){a.on("end",function(a){console.log(d(a))})};b.exports.convert=d},{}],21:[function(a,b,h){var e=a("json-stringify-safe"),d=function(a){return a&&"object"===("undefined"===
typeof a?"undefined":_typeof2(a))},m=function(a){return d(a)?a.stack||e(a):a},c=function(a){return a&&"function"===typeof a.then},g=function(a,b){return c(b)?b.then(a):a(b)};b.exports={isObject:d,isPromise:c,liftPromise:g,path:function(a){return function(b){return b.reduce(function(a,b){return a&&a[b]},a)}},pick:function(a){return function(b){return b[a]}},pipe:function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return function(a){return b.reduce(function(a,b){return g(b,
a)},a)}},reduce:function(a,b){return function(c){return c.reduce(a,b)}},flatten:function(a){return[].concat.apply([],a)},deepFlatten:function k(a){var b;return(b=[]).concat.apply(b,_toConsumableArray2(a.map(function(a){return Array.isArray(a)?k(a):a})))},map:function(a){return function(b){return b.map(a)}},filter:function(a){return function(b){return b.filter(a)}},identity:function(a){return a},wrapWith:function(a){return function(b){return _defineProperty2({},a,b)}},unwrapFrom:function(a){return function(b){return b[a]}},
promiseAll:function(a){return Promise.all(a)},partial:function(a){for(var b=arguments.length,c=Array(1<b?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];return function(){for(var b=arguments.length,d=Array(b),f=0;f<b;f++)d[f]=arguments[f];return a.apply(void 0,c.concat(d))}},isIn:function(a,b){return-1!==a.indexOf(b)},containsPath:function(a,b){return a.some(function(a){return b.match(new RegExp("/"+a+"/?$"))})},stringify:m,taggedStringify:function(a){for(var b=arguments.length,c=Array(1<b?b-1:0),d=1;d<b;d++)c[d-
1]=arguments[d];return a.reduce(function(a,b,d){return a+b+(m(c[d])||"")},"")},short:function(a,b){return function(c){return function(d){return a(d)?b(d):c(d)}}},hasProp:function(a){return function(b){return b in a}},last:function(a){return a[a.length-1]},upperCaseFirstLetter:function(a){return a[0].toUpperCase()+a.slice(1)},lowerCaseFirstLetter:function(a){return a[0].toLowerCase()+a.slice(1)},arrayOrPush:function(a,b,c){return Array.isArray(a[b])?a[b].push(c):a[b]=[c]},assignToObject:function(a,
b){return function(c,e){return d(a[b])?a[b][c]=e:a[b]=_defineProperty2({},c,e)}}}},{"json-stringify-safe":7}],22:[function(a,b,h){b.exports={Start:Symbol("Start"),End:Symbol("End"),expect:Symbol("expect"),pass:"pass",fail:"fail"}},{}]},{},[1])(1)});

443
es5/index.js

@ -73,7 +73,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
}return r;
}()({ 1: [function (require, module, exports) {
module.exports = require('../src/gunner');
}, { "../src/gunner": 9 }], 2: [function (require, module, exports) {
}, { "../src/gunner": 10 }], 2: [function (require, module, exports) {
(function (global) {
(function (f) {
if ((typeof exports === "undefined" ? "undefined" : _typeof2(exports)) === "object" && typeof module !== "undefined") {
@ -378,7 +378,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
};
module.exports = PromiseObject;
}, {}], 5: [function (require, module, exports) {}, {}], 6: [function (require, module, exports) {
}, {}], 5: [function (require, module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@ -860,7 +860,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
return fn.apply(context, arguments);
};
}
}, {}], 7: [function (require, module, exports) {
}, {}], 6: [function (require, module, exports) {
exports = module.exports = stringify;
exports.getSerialize = serializer;
@ -888,7 +888,247 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
return replacer == null ? value : replacer.call(this, key, value);
};
}
}, {}], 7: [function (require, module, exports) {
//copyright Ryan Day 2010 <http://ryanday.org>, Joscha Feth 2013 <http://www.feth.com> [MIT Licensed]
var element_start_char = "a-zA-Z_\xC0-\xD6\xD8-\xF6\xF8-\xFF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FFF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD";
var element_non_start_char = "-.0-9\xB7\u0300-\u036F\u203F\u2040";
var element_replace = new RegExp("^([^" + element_start_char + "])|^((x|X)(m|M)(l|L))|([^" + element_start_char + element_non_start_char + "])", "g");
var not_safe_in_xml = /[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm;
var process_to_xml = function process_to_xml(node_data, options) {
var makeNode = function makeNode(name, content, attributes, level, hasSubNodes) {
var indent_value = options.indent !== undefined ? options.indent : "\t";
var indent = options.prettyPrint ? '\n' + new Array(level).join(indent_value) : '';
if (options.removeIllegalNameCharacters) {
name = name.replace(element_replace, '_');
}
var node = [indent, '<', name, attributes || ''];
if (content && content.length > 0 || options.html) {
node.push('>');
node.push(content);
hasSubNodes && node.push(indent);
node.push('</');
node.push(name);
node.push('>');
} else {
node.push('/>');
}
return node.join('');
};
return function fn(node_data, node_descriptor, level) {
var type = typeof node_data === "undefined" ? "undefined" : _typeof2(node_data);
if (Array.isArray ? Array.isArray(node_data) : node_data instanceof Array) {
type = 'array';
} else if (node_data instanceof Date) {
type = 'date';
}
switch (type) {
//if value is an array create child nodes from values
case 'array':
var ret = [];
node_data.map(function (v) {
ret.push(fn(v, 1, level + 1));
//entries that are values of an array are the only ones that can be special node descriptors
});
options.prettyPrint && ret.push('\n');
return ret.join('');
break;
case 'date':
// cast dates to ISO 8601 date (soap likes it)
return node_data.toJSON ? node_data.toJSON() : node_data + '';
break;
case 'object':
if (node_descriptor == 1 && node_data.name) {
var content = [],
attributes = [];
if (node_data.attrs) {
if (_typeof2(node_data.attrs) != 'object') {
// attrs is a string, etc. - just use it as an attribute
attributes.push(' ');
attributes.push(node_data.attrs);
} else {
for (var key in node_data.attrs) {
var value = node_data.attrs[key];
attributes.push(' ');
attributes.push(key);
attributes.push('="');
attributes.push(options.escape ? esc(value) : value);
attributes.push('"');
}
}
}
//later attributes can be added here
if (typeof node_data.value != 'undefined') {
var c = '' + node_data.value;
content.push(options.escape && !node_data.noescape ? esc(c) : c);
} else if (typeof node_data.text != 'undefined') {
var c = '' + node_data.text;
content.push(options.escape && !node_data.noescape ? esc(c) : c);
}
if (node_data.children) {
content.push(fn(node_data.children, 0, level + 1));
}
return makeNode(node_data.name, content.join(''), attributes.join(''), level, !!node_data.children);
} else {
var nodes = [];
for (var name in node_data) {
nodes.push(makeNode(name, fn(node_data[name], 0, level + 1), null, level + 1));
}
options.prettyPrint && nodes.length > 0 && nodes.push('\n');
return nodes.join('');
}
break;
case 'function':
return node_data();
break;
default:
return options.escape ? esc(node_data) : '' + node_data;
}
}(node_data, 0, 0);
};
var xml_header = function xml_header(standalone) {
var ret = ['<?xml version="1.0" encoding="utf-8"'];
if (standalone) {
ret.push(' standalone="yes"');
}
ret.push('?>');
return ret.join('');
};
module.exports = function (obj, options) {
var Buffer = this.Buffer || function Buffer() {};
if (typeof obj == 'string' || obj instanceof Buffer) {
try {
obj = JSON.parse(obj.toString());
} catch (e) {
return false;
}
}
var xmlheader = '';
var docType = '';
if (options) {
if ((typeof options === "undefined" ? "undefined" : _typeof2(options)) == 'object') {
// our config is an object
if (options.xmlHeader) {
// the user wants an xml header
xmlheader = xml_header(!!options.xmlHeader.standalone);
}
if (typeof options.docType != 'undefined') {
docType = '<!DOCTYPE ' + options.docType + '>';
}
} else {
// our config is a boolean value, so just add xml header
xmlheader = xml_header();
}
}
options = options || {};
var ret = [xmlheader, options.prettyPrint && docType ? '\n' : '', docType, process_to_xml(obj, options)];
return ret.join('');
};
module.exports.json_to_xml = module.exports.obj_to_xml = module.exports;
module.exports.escape = esc;
function esc(str) {
return ('' + str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/'/g, '&apos;').replace(/"/g, '&quot;').replace(not_safe_in_xml, '');
}
module.exports.cdata = cdata;
function cdata(str) {
if (str) return "<![CDATA[" + str.replace(/]]>/g, '') + ']]>';
return "<![CDATA[]]>";
};
}, {}], 8: [function (require, module, exports) {
exports.endianness = function () {
return 'LE';
};
exports.hostname = function () {
if (typeof location !== 'undefined') {
return location.hostname;
} else return '';
};
exports.loadavg = function () {
return [];
};
exports.uptime = function () {
return 0;
};
exports.freemem = function () {
return Number.MAX_VALUE;
};
exports.totalmem = function () {
return Number.MAX_VALUE;
};
exports.cpus = function () {
return [];
};
exports.type = function () {
return 'Browser';
};
exports.release = function () {
if (typeof navigator !== 'undefined') {
return navigator.appVersion;
}
return '';
};
exports.networkInterfaces = exports.getNetworkInterfaces = function () {
return {};
};
exports.arch = function () {
return 'javascript';
};
exports.platform = function () {
return 'browser';
};
exports.tmpdir = exports.tmpDir = function () {
return '/tmp';
};
exports.EOL = '\n';
exports.homedir = function () {
return '/';
};
}, {}], 9: [function (require, module, exports) {
// shim for using process in browser
var process = module.exports = {};
@ -1074,7 +1314,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
process.umask = function () {
return 0;
};
}, {}], 9: [function (require, module, exports) {
}, {}], 10: [function (require, module, exports) {
(function (process) {
'use strict';
@ -1181,7 +1421,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
emitter.emit('test end', results);
emitter.emit('end', results);
return options.request ? (_ref = {}, _defineProperty2(_ref, options.request, reporters[options.request].convert(results)), _defineProperty2(_ref, "json", results), _ref) : results;
return options.request ? (_ref = {}, _defineProperty2(_ref, options.request, reporters[options.request].convert(results)), _defineProperty2(_ref, "default", results), _ref) : results;
});
}
}]);
@ -1196,7 +1436,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
module.exports.End = symbols.End;
module.exports.Gunner = module.exports;
}).call(this, require('_process'));
}, { "./lib/caller": 13, "./lib/emitter": 14, "./lib/expect": 15, "./lib/testrunner": 16, "./reporters": 18, "./util": 21, "./util/symbols": 22, "_process": 8 }], 10: [function (require, module, exports) {
}, { "./lib/caller": 14, "./lib/emitter": 15, "./lib/expect": 16, "./lib/testrunner": 17, "./reporters": 19, "./util": 24, "./util/symbols": 26, "_process": 9 }], 11: [function (require, module, exports) {
var _require2 = require('../util'),
isPromise = _require2.isPromise;
@ -1227,7 +1467,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
};
module.exports = assertPromise;
}, { "../util": 21 }], 11: [function (require, module, exports) {
}, { "../util": 24 }], 12: [function (require, module, exports) {
var isEq = require('@codefeathers/iseq');
var U = require('../util');
var _ = U.taggedStringify;
@ -1352,7 +1592,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
module.exports.match = module.exports.deepEquals;
module.exports.greaterThanOrEqualTo = module.exports.gte;
module.exports.lessThanOrEqualTo = module.exports.lte;
}, { "../util": 21, "@codefeathers/iseq": 2 }], 12: [function (require, module, exports) {
}, { "../util": 24, "@codefeathers/iseq": 2 }], 13: [function (require, module, exports) {
// Only imported for JSDoc
/* eslint-disable-next-line */
var Gunner = require('../gunner');
@ -1386,7 +1626,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
};
module.exports = buildTestTree;
}, { "../gunner": 9, "../util/symbols": 22 }], 13: [function (require, module, exports) {
}, { "../gunner": 10, "../util/symbols": 26 }], 14: [function (require, module, exports) {
var _require3 = require('../util'),
isPromise = _require3.isPromise;
@ -1436,7 +1676,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
};
module.exports = caller;
}, { "../util": 21 }], 14: [function (require, module, exports) {
}, { "../util": 24 }], 15: [function (require, module, exports) {
var EventEmitter = require('events');
var GunnerEmitter = function (_EventEmitter) {
@ -1452,7 +1692,7 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
}(EventEmitter);
module.exports = new GunnerEmitter();
}, { "events": 6 }], 15: [function (require, module, exports) {
}, { "events": 5 }], 16: [function (require, module, exports) {
'use strict';
var _require4 = require('../util'),
@ -1517,21 +1757,22 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
module.exports = expect;
module.exports.expectMany = expectMany;
}, { "../util": 21, "./assertPromise": 10, "./assertionsLibrary": 11 }], 16: [function (require, module, exports) {
}, { "../util": 24, "./assertPromise": 11, "./assertionsLibrary": 12 }], 17: [function (require, module, exports) {
// Only imported for JSDoc
/* eslint-disable-next-line */
var Gunner = require('../gunner');
Promise.object = require('@codefeathers/promise.object');
var _require5 = require('perf_hooks'),
performance = _require5.performance;
var _require5 = require('../util'),
last = _require5.last,
pipe = _require5.pipe,
pick = _require5.pick,
assignToObject = _require5.assignToObject;
var _require6 = require('../util'),
last = _require6.last,
pipe = _require6.pipe,
pick = _require6.pick,
assignToObject = _require6.assignToObject;
var _require6 = require('../util/constants'),
eventMap = _require6.eventMap;
var emitter = require('./emitter');
var buildTestQueue = require('./buildTestQueue');
var findSkip = function findSkip(skip, unit) {
@ -1577,6 +1818,9 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
duration: duration,
description: item.unit.description
}, (status === 'notOk' || status === 'skip') && { reason: result.error || result.rejection || result.description });
emitter.emit(eventMap[status], resultObject);
acc.results.push(resultObject);
} else {
@ -1618,13 +1862,16 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
var perf = { start: Date.now() };
return Promise.object(pipe(buildTestQueue, reduceQueue, pick('results'))(instance)).then(function (results) {
results.duration = Date.now() - perf.start;
perf.end = Date.now();
results.end = perf.end.toUTCString();
results.start = perf.start.toUTCString();
results.duration = perf.end - perf.start;
return results;
});
};
module.exports = testrunner;
}, { "../gunner": 9, "../util": 21, "./buildTestQueue": 12, "@codefeathers/promise.object": 3, "perf_hooks": 5 }], 17: [function (require, module, exports) {
}, { "../gunner": 10, "../util": 24, "../util/constants": 23, "./buildTestQueue": 13, "./emitter": 15, "@codefeathers/promise.object": 3 }], 18: [function (require, module, exports) {
var statusMap = {
'ok': ['ok', '✅'],
@ -1663,15 +1910,65 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
module.exports = Default;
module.exports.convert = convert;
}, {}], 18: [function (require, module, exports) {
}, {}], 19: [function (require, module, exports) {
module.exports = {
default: require('./default'),
tap: require('./tap'),
xunit: require('./xunit')
xunit: require('./xunit'),
min: require('./min')
};
}, { "./default": 18, "./min": 20, "./tap": 21, "./xunit": 22 }], 20: [function (require, module, exports) {
var _require7 = require('../util/constants'),
eventMap = _require7.eventMap,
eventVerbs = _require7.eventVerbs;
var _require8 = require('../util/nodeutils'),
clear = _require8.clear;
var convert = function convert(x) {
return x;
};
var count = {
pass: 0,
fail: 0,
skip: 0,
collapse: function collapse() {
return this.pass + this.fail + this.skip;
}
};
var doneHandler = function doneHandler(event) {
clear();
var mapEvent = eventMap[event.status];
count[mapEvent]++;
console.log(count[mapEvent] + " tests " + eventVerbs[mapEvent][2] + (" (total: " + count.collapse() + ")"));
};
var Min = function Min(runner) {
runner.on('start', function () {
return console.log('Started tests');
});
runner.on('pass', doneHandler);
runner.on('fail', doneHandler);
runner.on('skip', doneHandler);
runner.on('end', function (results) {
clear();
console.log("Test suite " + results.name + " has done running.");
console.log('Success ratio:', results.successPercent, '%');
});
};
}, { "./default": 17, "./tap": 19, "./xunit": 20 }], 19: [function (require, module, exports) {
module.exports = Min;
module.exports.convert = convert;
}, { "../util/constants": 23, "../util/nodeutils": 25 }], 21: [function (require, module, exports) {
var statusMap = {
'ok': 'ok',
@ -1698,61 +1995,83 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
module.exports = TAP;
module.exports.convert = convert;
}, {}], 20: [function (require, module, exports) {
var tag = function tag(name, attrs, close, content) {
var end = close ? "/>" : ">";
var pairs = [];
var tag = void 0;
}, {}], 22: [function (require, module, exports) {
var toXML = require('jsontoxml');
Object.keys(attrs).forEach(function (key) {
if (Object.prototype.hasOwnProperty.call(attrs, key)) {
pairs.push(key + '="' + attrs[key] + '"');
}
});
var _require9 = require('../util/nodeutils'),
clear = _require9.clear;
tag = "<" + name + (pairs.length ? " " + pairs.join(" ") : "") + end;
if (content) {
tag += content + "</" + name + end;
}
return new String(tag);
};
var toJSON = function toJSON(resultsArray) {
var convert = function convert(results) {
var count = results.count,
return {
testsuites: resultsArray.map(function (results) {
var name = results.name,
count = results.count,
success = results.success,
failures = results.failures,
skipped = results.skipped;
return '<?xml version="1.0"?>' + tag('testsuites', {}, false, tag('testsuite', {
name: results.name,
return {
name: 'testsuite',
attrs: {
name: name,
tests: count,
success: success.length,
failures: failures.length,
skipped: skipped.length,
timestamp: new Date().toUTCString(),
time: results.duration / 1000 || 0
}, false, results.reduce(function (acc, r) {
var close = r.status === 'ok';
var content = r.status !== 'ok' && (r.status === 'skip' ? tag('skipped', {}, true) : tag('failure', {}, !r.reason, r.reason ? r.reason : ''));
acc += tag('testcase', {
},
children: results.reduce(function (acc, r) {
var content = r.status !== 'ok' && (r.status === 'skip' ? 'skipped' : {
name: 'failure',
text: r.reason ? r.reason && r.reason.stack : ''
});
acc.push(_extends2({
name: 'testcase',
attrs: {
name: r.description,
time: r.duration / 1000 || 0
}, close, content || '');
}
}, (typeof content === "undefined" ? "undefined" : _typeof2(content)) === 'object' && { text: content && content.stack }, (typeof content === "undefined" ? "undefined" : _typeof2(content)) === 'object' && { children: [content] }));
return acc;
}, '')));
}, [])
};
})
};
};
var xunit = function xunit(runner) {
runner.on("end", function (results) {
var convert = function convert(results) {
return toXML(toJSON(results), { xmlHeader: { standalone: true } });
};
console.log(convert(results));
var xunit = function xunit(runner) {
return runner.on("end", function (results) {
return clear(), console.log(convert([results]));
});
};
module.exports = xunit;
module.exports.convert = convert;
}, {}], 21: [function (require, module, exports) {
}, { "../util/nodeutils": 25, "jsontoxml": 7 }], 23: [function (require, module, exports) {
var _require10 = require('os'),
EOL = _require10.EOL;
module.exports = {
EOL: EOL,
eventMap: {
'ok': 'pass',
'notOk': 'fail',
'skip': 'skip'
},
eventVerbs: {
pass: ['pass', 'passing', 'passed'],
fail: ['fail', 'failing', 'failed'],
skip: ['skip', 'skipping', 'skipped']
}
};
}, { "os": 8 }], 24: [function (require, module, exports) {
var _stringify = require('json-stringify-safe');
var isObject = function isObject(x) {
@ -1959,7 +2278,21 @@ function _toConsumableArray2(arr) { if (Array.isArray(arr)) { for (var i = 0, ar
}
};
}, { "json-stringify-safe": 7 }], 22: [function (require, module, exports) {
}, { "json-stringify-safe": 6 }], 25: [function (require, module, exports) {
(function (process) {
module.exports = {
clear: function clear() {
// clear screen
process.stdout.write("\x1B[2J");
// set cursor position to top
process.stdout.write("\x1B[1;1H");
}
};
}).call(this, require('_process'));
}, { "_process": 9 }], 26: [function (require, module, exports) {
module.exports = {
Start: Symbol('Start'),

5
package.json

@ -1,6 +1,6 @@
{
"name": "@klenty/gunner",
"version": "0.11.0",
"version": "0.11.1",
"description": "Zero magic, fast test-runner and assertion framework. No magic globals.",
"main": "es6/index.js",
"repository": {
@ -15,8 +15,7 @@
"unit testing"
],
"scripts": {
"build": "rm -rf ./es5 && mkdir ./es5 && browserify ./es6/index.js -s Gunner > ./es5/index.js && babel --presets=env --plugins=babel-plugin-transform-object-rest-spread ./es5/index.js -o ./es5/index.js",
"build:closure": "./scripts/closure.sh"
"build": "rm -rf ./es5 && mkdir ./es5 && browserify ./es6/index.js -s Gunner > ./es5/index.js && babel --presets=env --plugins=babel-plugin-transform-object-rest-spread ./es5/index.js -o ./es5/index.js"
},
"author": "Muthu Kumar <@MKRhere> (https://mkr.pw)",
"license": "MIT",

4
scripts/closure.sh

@ -1,4 +0,0 @@
#!/bin/bash
java -jar $CLOSURE_COMPILER_PATH ./es5/index.js --js_output_file ./es5/dist.js --language_out ECMASCRIPT5 --warning_level QUIET
echo "Done!"
Loading…
Cancel
Save