UNPKG

supergroup

Version:

Nested groups on arrays of objects where groups are Strings that know what you want them to know about themselves and their relatives.

27 lines 995 kB
"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj;}; /******/(function(modules){ // webpackBootstrap /******/ // The module cache /******/var installedModules={}; /******/ // 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]={ /******/exports:{}, /******/id:moduleId, /******/loaded:false /******/}; /******/ // Execute the module function /******/modules[moduleId].call(module.exports,module,module.exports,__webpack_require__); /******/ // Flag the module as loaded /******/module.loaded=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; /******/ // __webpack_public_path__ /******/__webpack_require__.p=""; /******/ // Load entry module and return exports /******/return __webpack_require__(0); /******/})( /************************************************************************/ /******/[ /* 0 */ /***/function(module,exports,__webpack_require__){__webpack_require__(1);module.exports=__webpack_require__(25); /***/}, /* 1 */ /***/function(module,exports,__webpack_require__){__webpack_require__(2);mocha.setup("bdd");__webpack_require__(10);__webpack_require__(24);if(false){module.hot.accept();module.hot.dispose(function(){mocha.suite.suites.length=0;var stats=document.getElementById('mocha-stats');var report=document.getElementById('mocha-report');stats.parentNode.removeChild(stats);report.parentNode.removeChild(report);});} /***/}, /* 2 */ /***/function(module,exports,__webpack_require__){if(!document.getElementById("mocha")){document.write("<div id=\"mocha\"></div>");}__webpack_require__(3);__webpack_require__(7); /***/}, /* 3 */ /***/function(module,exports,__webpack_require__){ // style-loader: Adds some css to the DOM by adding a <style> tag // load the styles var content=__webpack_require__(4);if(typeof content==='string')content=[[module.id,content,'']]; // add the styles to the DOM var update=__webpack_require__(6)(content,{}); // Hot Module Replacement if(false){ // When the styles change, update the <style> tags module.hot.accept("!!/Users/sigfried/Sites/git_projects/supergroup/node_modules/css-loader/index.js!/Users/sigfried/Sites/git_projects/supergroup/node_modules/mocha/mocha.css",function(){var newContent=require("!!/Users/sigfried/Sites/git_projects/supergroup/node_modules/css-loader/index.js!/Users/sigfried/Sites/git_projects/supergroup/node_modules/mocha/mocha.css");if(typeof newContent==='string')newContent=[[module.id,newContent,'']];update(newContent);}); // When the module is disposed, remove the <style> tags module.hot.dispose(function(){update();});} /***/}, /* 4 */ /***/function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(5)();exports.push([module.id,"@charset \"utf-8\";\n\nbody {\n margin:0;\n}\n\n#mocha {\n font: 20px/1.5 \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n margin: 60px 50px;\n}\n\n#mocha ul,\n#mocha li {\n margin: 0;\n padding: 0;\n}\n\n#mocha ul {\n list-style: none;\n}\n\n#mocha h1,\n#mocha h2 {\n margin: 0;\n}\n\n#mocha h1 {\n margin-top: 15px;\n font-size: 1em;\n font-weight: 200;\n}\n\n#mocha h1 a {\n text-decoration: none;\n color: inherit;\n}\n\n#mocha h1 a:hover {\n text-decoration: underline;\n}\n\n#mocha .suite .suite h1 {\n margin-top: 0;\n font-size: .8em;\n}\n\n#mocha .hidden {\n display: none;\n}\n\n#mocha h2 {\n font-size: 12px;\n font-weight: normal;\n cursor: pointer;\n}\n\n#mocha .suite {\n margin-left: 15px;\n}\n\n#mocha .test {\n margin-left: 15px;\n overflow: hidden;\n}\n\n#mocha .test.pending:hover h2::after {\n content: '(pending)';\n font-family: arial, sans-serif;\n}\n\n#mocha .test.pass.medium .duration {\n background: #c09853;\n}\n\n#mocha .test.pass.slow .duration {\n background: #b94a48;\n}\n\n#mocha .test.pass::before {\n content: '✓';\n font-size: 12px;\n display: block;\n float: left;\n margin-right: 5px;\n color: #00d6b2;\n}\n\n#mocha .test.pass .duration {\n font-size: 9px;\n margin-left: 5px;\n padding: 2px 5px;\n color: #fff;\n -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);\n -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);\n box-shadow: inset 0 1px 1px rgba(0,0,0,.2);\n -webkit-border-radius: 5px;\n -moz-border-radius: 5px;\n -ms-border-radius: 5px;\n -o-border-radius: 5px;\n border-radius: 5px;\n}\n\n#mocha .test.pass.fast .duration {\n display: none;\n}\n\n#mocha .test.pending {\n color: #0b97c4;\n}\n\n#mocha .test.pending::before {\n content: '◦';\n color: #0b97c4;\n}\n\n#mocha .test.fail {\n color: #c00;\n}\n\n#mocha .test.fail pre {\n color: black;\n}\n\n#mocha .test.fail::before {\n content: '✖';\n font-size: 12px;\n display: block;\n float: left;\n margin-right: 5px;\n color: #c00;\n}\n\n#mocha .test pre.error {\n color: #c00;\n max-height: 300px;\n overflow: auto;\n}\n\n#mocha .test .html-error {\n overflow: auto;\n color: black;\n line-height: 1.5;\n display: block;\n float: left;\n clear: left;\n font: 12px/1.5 monaco, monospace;\n margin: 5px;\n padding: 15px;\n border: 1px solid #eee;\n max-width: 85%; /*(1)*/\n max-width: calc(100% - 42px); /*(2)*/\n max-height: 300px;\n word-wrap: break-word;\n border-bottom-color: #ddd;\n -webkit-border-radius: 3px;\n -webkit-box-shadow: 0 1px 3px #eee;\n -moz-border-radius: 3px;\n -moz-box-shadow: 0 1px 3px #eee;\n border-radius: 3px;\n}\n\n#mocha .test .html-error pre.error {\n border: none;\n -webkit-border-radius: none;\n -webkit-box-shadow: none;\n -moz-border-radius: none;\n -moz-box-shadow: none;\n padding: 0;\n margin: 0;\n margin-top: 18px;\n max-height: none;\n}\n\n/**\n * (1): approximate for browsers not supporting calc\n * (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)\n * ^^ seriously\n */\n#mocha .test pre {\n display: block;\n float: left;\n clear: left;\n font: 12px/1.5 monaco, monospace;\n margin: 5px;\n padding: 15px;\n border: 1px solid #eee;\n max-width: 85%; /*(1)*/\n max-width: calc(100% - 42px); /*(2)*/\n word-wrap: break-word;\n border-bottom-color: #ddd;\n -webkit-border-radius: 3px;\n -webkit-box-shadow: 0 1px 3px #eee;\n -moz-border-radius: 3px;\n -moz-box-shadow: 0 1px 3px #eee;\n border-radius: 3px;\n}\n\n#mocha .test h2 {\n position: relative;\n}\n\n#mocha .test a.replay {\n position: absolute;\n top: 3px;\n right: 0;\n text-decoration: none;\n vertical-align: middle;\n display: block;\n width: 15px;\n height: 15px;\n line-height: 15px;\n text-align: center;\n background: #eee;\n font-size: 15px;\n -moz-border-radius: 15px;\n border-radius: 15px;\n -webkit-transition: opacity 200ms;\n -moz-transition: opacity 200ms;\n transition: opacity 200ms;\n opacity: 0.3;\n color: #888;\n}\n\n#mocha .test:hover a.replay {\n opacity: 1;\n}\n\n#mocha-report.pass .test.fail {\n display: none;\n}\n\n#mocha-report.fail .test.pass {\n display: none;\n}\n\n#mocha-report.pending .test.pass,\n#mocha-report.pending .test.fail {\n display: none;\n}\n#mocha-report.pending .test.pass.pending {\n display: block;\n}\n\n#mocha-error {\n color: #c00;\n font-size: 1.5em;\n font-weight: 100;\n letter-spacing: 1px;\n}\n\n#mocha-stats {\n position: fixed;\n top: 15px;\n right: 10px;\n font-size: 12px;\n margin: 0;\n color: #888;\n z-index: 1;\n}\n\n#mocha-stats .progress {\n float: right;\n padding-top: 0;\n}\n\n#mocha-stats em {\n color: black;\n}\n\n#mocha-stats a {\n text-decoration: none;\n color: inherit;\n}\n\n#mocha-stats a:hover {\n border-bottom: 1px solid #eee;\n}\n\n#mocha-stats li {\n display: inline-block;\n margin: 0 5px;\n list-style: none;\n padding-top: 11px;\n}\n\n#mocha-stats canvas {\n width: 40px;\n height: 40px;\n}\n\n#mocha code .comment { color: #ddd; }\n#mocha code .init { color: #2f6fad; }\n#mocha code .string { color: #5890ad; }\n#mocha code .keyword { color: #8a6343; }\n#mocha code .number { color: #2f6fad; }\n\n@media screen and (max-device-width: 480px) {\n #mocha {\n margin: 60px 0px;\n }\n\n #mocha #stats {\n position: absolute;\n }\n}\n",""]); /***/}, /* 5 */ /***/function(module,exports){module.exports=function(){var list=[];list.toString=function toString(){var result=[];for(var i=0;i<this.length;i++){var item=this[i];if(item[2]){result.push("@media "+item[2]+"{"+item[1]+"}");}else {result.push(item[1]);}}return result.join("");};return list;}; /***/}, /* 6 */ /***/function(module,exports,__webpack_require__){ /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */var stylesInDom={},memoize=function memoize(fn){var memo;return function(){if(typeof memo==="undefined")memo=fn.apply(this,arguments);return memo;};},isIE9=memoize(function(){return (/msie 9\b/.test(window.navigator.userAgent.toLowerCase()));}),getHeadElement=memoize(function(){return document.head||document.getElementsByTagName("head")[0];}),singletonElement=null,singletonCounter=0;module.exports=function(list,options){if(false){if((typeof document==="undefined"?"undefined":_typeof(document))!=="object")throw new Error("The style-loader cannot be used in a non-browser environment");}options=options||{}; // Force single-tag solution on IE9, which has a hard limit on the # of <style> // tags it will allow on a page if(typeof options.singleton==="undefined")options.singleton=isIE9();var styles=listToStyles(list);addStylesToDom(styles,options);return function update(newList){var mayRemove=[];for(var i=0;i<styles.length;i++){var item=styles[i];var domStyle=stylesInDom[item.id];domStyle.refs--;mayRemove.push(domStyle);}if(newList){var newStyles=listToStyles(newList);addStylesToDom(newStyles,options);}for(var i=0;i<mayRemove.length;i++){var domStyle=mayRemove[i];if(domStyle.refs===0){for(var j=0;j<domStyle.parts.length;j++){domStyle.parts[j]();}delete stylesInDom[domStyle.id];}}};};function addStylesToDom(styles,options){for(var i=0;i<styles.length;i++){var item=styles[i];var domStyle=stylesInDom[item.id];if(domStyle){domStyle.refs++;for(var j=0;j<domStyle.parts.length;j++){domStyle.parts[j](item.parts[j]);}for(;j<item.parts.length;j++){domStyle.parts.push(addStyle(item.parts[j],options));}}else {var parts=[];for(var j=0;j<item.parts.length;j++){parts.push(addStyle(item.parts[j],options));}stylesInDom[item.id]={id:item.id,refs:1,parts:parts};}}}function listToStyles(list){var styles=[];var newStyles={};for(var i=0;i<list.length;i++){var item=list[i];var id=item[0];var css=item[1];var media=item[2];var sourceMap=item[3];var part={css:css,media:media,sourceMap:sourceMap};if(!newStyles[id])styles.push(newStyles[id]={id:id,parts:[part]});else newStyles[id].parts.push(part);}return styles;}function createStyleElement(){var styleElement=document.createElement("style");var head=getHeadElement();styleElement.type="text/css";head.appendChild(styleElement);return styleElement;}function addStyle(obj,options){var styleElement,update,remove;if(options.singleton){var styleIndex=singletonCounter++;styleElement=singletonElement||(singletonElement=createStyleElement());update=applyToSingletonTag.bind(null,styleElement,styleIndex,false);remove=applyToSingletonTag.bind(null,styleElement,styleIndex,true);}else {styleElement=createStyleElement();update=applyToTag.bind(null,styleElement);remove=function remove(){styleElement.parentNode.removeChild(styleElement);};}update(obj);return function updateStyle(newObj){if(newObj){if(newObj.css===obj.css&&newObj.media===obj.media&&newObj.sourceMap===obj.sourceMap)return;update(obj=newObj);}else {remove();}};}function replaceText(source,id,replacement){var boundaries=["/** >>"+id+" **/","/** "+id+"<< **/"];var start=source.lastIndexOf(boundaries[0]);var wrappedReplacement=replacement?boundaries[0]+replacement+boundaries[1]:"";if(source.lastIndexOf(boundaries[0])>=0){var end=source.lastIndexOf(boundaries[1])+boundaries[1].length;return source.slice(0,start)+wrappedReplacement+source.slice(end);}else {return source+wrappedReplacement;}}function applyToSingletonTag(styleElement,index,remove,obj){var css=remove?"":obj.css;if(styleElement.styleSheet){styleElement.styleSheet.cssText=replaceText(styleElement.styleSheet.cssText,index,css);}else {var cssNode=document.createTextNode(css);var childNodes=styleElement.childNodes;if(childNodes[index])styleElement.removeChild(childNodes[index]);if(childNodes.length){styleElement.insertBefore(cssNode,childNodes[index]);}else {styleElement.appendChild(cssNode);}}}function applyToTag(styleElement,obj){var css=obj.css;var media=obj.media;var sourceMap=obj.sourceMap;if(sourceMap&&typeof btoa==="function"){try{css+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(JSON.stringify(sourceMap))+" */";css="@import url(\"data:text/css;base64,"+btoa(css)+"\")";}catch(e){}}if(media){styleElement.setAttribute("media",media);}if(styleElement.styleSheet){styleElement.styleSheet.cssText=css;}else {while(styleElement.firstChild){styleElement.removeChild(styleElement.firstChild);}styleElement.appendChild(document.createTextNode(css));}} /***/}, /* 7 */ /***/function(module,exports,__webpack_require__){__webpack_require__(8)(__webpack_require__(9)); /***/}, /* 8 */ /***/function(module,exports){ /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */module.exports=function(src){if(typeof execScript==="function")execScript(src);else eval.call(null,src);}; /***/}, /* 9 */ /***/function(module,exports){module.exports="(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n(function (process){\nmodule.exports = process.env.COV\n ? require('./lib-cov/mocha')\n : require('./lib/mocha');\n\n}).call(this,require('_process'))\n},{\"./lib-cov/mocha\":undefined,\"./lib/mocha\":14,\"_process\":51}],2:[function(require,module,exports){\n/* eslint-disable no-unused-vars */\nmodule.exports = function(type) {\n return function() {};\n};\n\n},{}],3:[function(require,module,exports){\n/**\n * Module exports.\n */\n\nexports.EventEmitter = EventEmitter;\n\n/**\n * Object#hasOwnProperty reference.\n */\nvar objToString = Object.prototype.toString;\n\n/**\n * Check if a value is an array.\n *\n * @api private\n * @param {*} val The value to test.\n * @return {boolean} true if the value is a boolean, otherwise false.\n */\nfunction isArray(val) {\n return objToString.call(val) === '[object Array]';\n}\n\n/**\n * Event emitter constructor.\n *\n * @api public\n */\nfunction EventEmitter() {}\n\n/**\n * Add a listener.\n *\n * @api public\n * @param {string} name Event name.\n * @param {Function} fn Event handler.\n * @return {EventEmitter} Emitter instance.\n */\nEventEmitter.prototype.on = function(name, fn) {\n if (!this.$events) {\n this.$events = {};\n }\n\n if (!this.$events[name]) {\n this.$events[name] = fn;\n } else if (isArray(this.$events[name])) {\n this.$events[name].push(fn);\n } else {\n this.$events[name] = [this.$events[name], fn];\n }\n\n return this;\n};\n\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n/**\n * Adds a volatile listener.\n *\n * @api public\n * @param {string} name Event name.\n * @param {Function} fn Event handler.\n * @return {EventEmitter} Emitter instance.\n */\nEventEmitter.prototype.once = function(name, fn) {\n var self = this;\n\n function on() {\n self.removeListener(name, on);\n fn.apply(this, arguments);\n }\n\n on.listener = fn;\n this.on(name, on);\n\n return this;\n};\n\n/**\n * Remove a listener.\n *\n * @api public\n * @param {string} name Event name.\n * @param {Function} fn Event handler.\n * @return {EventEmitter} Emitter instance.\n */\nEventEmitter.prototype.removeListener = function(name, fn) {\n if (this.$events && this.$events[name]) {\n var list = this.$events[name];\n\n if (isArray(list)) {\n var pos = -1;\n\n for (var i = 0, l = list.length; i < l; i++) {\n if (list[i] === fn || (list[i].listener && list[i].listener === fn)) {\n pos = i;\n break;\n }\n }\n\n if (pos < 0) {\n return this;\n }\n\n list.splice(pos, 1);\n\n if (!list.length) {\n delete this.$events[name];\n }\n } else if (list === fn || (list.listener && list.listener === fn)) {\n delete this.$events[name];\n }\n }\n\n return this;\n};\n\n/**\n * Remove all listeners for an event.\n *\n * @api public\n * @param {string} name Event name.\n * @return {EventEmitter} Emitter instance.\n */\nEventEmitter.prototype.removeAllListeners = function(name) {\n if (name === undefined) {\n this.$events = {};\n return this;\n }\n\n if (this.$events && this.$events[name]) {\n this.$events[name] = null;\n }\n\n return this;\n};\n\n/**\n * Get all listeners for a given event.\n *\n * @api public\n * @param {string} name Event name.\n * @return {EventEmitter} Emitter instance.\n */\nEventEmitter.prototype.listeners = function(name) {\n if (!this.$events) {\n this.$events = {};\n }\n\n if (!this.$events[name]) {\n this.$events[name] = [];\n }\n\n if (!isArray(this.$events[name])) {\n this.$events[name] = [this.$events[name]];\n }\n\n return this.$events[name];\n};\n\n/**\n * Emit an event.\n *\n * @api public\n * @param {string} name Event name.\n * @return {boolean} true if at least one handler was invoked, else false.\n */\nEventEmitter.prototype.emit = function(name) {\n if (!this.$events) {\n return false;\n }\n\n var handler = this.$events[name];\n\n if (!handler) {\n return false;\n }\n\n var args = Array.prototype.slice.call(arguments, 1);\n\n if (typeof handler === 'function') {\n handler.apply(this, args);\n } else if (isArray(handler)) {\n var listeners = handler.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i].apply(this, args);\n }\n } else {\n return false;\n }\n\n return true;\n};\n\n},{}],4:[function(require,module,exports){\n/**\n * Expose `Progress`.\n */\n\nmodule.exports = Progress;\n\n/**\n * Initialize a new `Progress` indicator.\n */\nfunction Progress() {\n this.percent = 0;\n this.size(0);\n this.fontSize(11);\n this.font('helvetica, arial, sans-serif');\n}\n\n/**\n * Set progress size to `size`.\n *\n * @api public\n * @param {number} size\n * @return {Progress} Progress instance.\n */\nProgress.prototype.size = function(size) {\n this._size = size;\n return this;\n};\n\n/**\n * Set text to `text`.\n *\n * @api public\n * @param {string} text\n * @return {Progress} Progress instance.\n */\nProgress.prototype.text = function(text) {\n this._text = text;\n return this;\n};\n\n/**\n * Set font size to `size`.\n *\n * @api public\n * @param {number} size\n * @return {Progress} Progress instance.\n */\nProgress.prototype.fontSize = function(size) {\n this._fontSize = size;\n return this;\n};\n\n/**\n * Set font to `family`.\n *\n * @param {string} family\n * @return {Progress} Progress instance.\n */\nProgress.prototype.font = function(family) {\n this._font = family;\n return this;\n};\n\n/**\n * Update percentage to `n`.\n *\n * @param {number} n\n * @return {Progress} Progress instance.\n */\nProgress.prototype.update = function(n) {\n this.percent = n;\n return this;\n};\n\n/**\n * Draw on `ctx`.\n *\n * @param {CanvasRenderingContext2d} ctx\n * @return {Progress} Progress instance.\n */\nProgress.prototype.draw = function(ctx) {\n try {\n var percent = Math.min(this.percent, 100);\n var size = this._size;\n var half = size / 2;\n var x = half;\n var y = half;\n var rad = half - 1;\n var fontSize = this._fontSize;\n\n ctx.font = fontSize + 'px ' + this._font;\n\n var angle = Math.PI * 2 * (percent / 100);\n ctx.clearRect(0, 0, size, size);\n\n // outer circle\n ctx.strokeStyle = '#9f9f9f';\n ctx.beginPath();\n ctx.arc(x, y, rad, 0, angle, false);\n ctx.stroke();\n\n // inner circle\n ctx.strokeStyle = '#eee';\n ctx.beginPath();\n ctx.arc(x, y, rad - 1, 0, angle, true);\n ctx.stroke();\n\n // text\n var text = this._text || (percent | 0) + '%';\n var w = ctx.measureText(text).width;\n\n ctx.fillText(text, x - w / 2 + 1, y + fontSize / 2 - 1);\n } catch (err) {\n // don't fail if we can't render progress\n }\n return this;\n};\n\n},{}],5:[function(require,module,exports){\n(function (global){\nexports.isatty = function isatty() {\n return true;\n};\n\nexports.getWindowSize = function getWindowSize() {\n if ('innerHeight' in global) {\n return [global.innerHeight, global.innerWidth];\n }\n // In a Web Worker, the DOM Window is not available.\n return [640, 480];\n};\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],6:[function(require,module,exports){\n/**\n * Expose `Context`.\n */\n\nmodule.exports = Context;\n\n/**\n * Initialize a new `Context`.\n *\n * @api private\n */\nfunction Context() {}\n\n/**\n * Set or get the context `Runnable` to `runnable`.\n *\n * @api private\n * @param {Runnable} runnable\n * @return {Context}\n */\nContext.prototype.runnable = function(runnable) {\n if (!arguments.length) {\n return this._runnable;\n }\n this.test = this._runnable = runnable;\n return this;\n};\n\n/**\n * Set test timeout `ms`.\n *\n * @api private\n * @param {number} ms\n * @return {Context} self\n */\nContext.prototype.timeout = function(ms) {\n if (!arguments.length) {\n return this.runnable().timeout();\n }\n this.runnable().timeout(ms);\n return this;\n};\n\n/**\n * Set test timeout `enabled`.\n *\n * @api private\n * @param {boolean} enabled\n * @return {Context} self\n */\nContext.prototype.enableTimeouts = function(enabled) {\n this.runnable().enableTimeouts(enabled);\n return this;\n};\n\n/**\n * Set test slowness threshold `ms`.\n *\n * @api private\n * @param {number} ms\n * @return {Context} self\n */\nContext.prototype.slow = function(ms) {\n this.runnable().slow(ms);\n return this;\n};\n\n/**\n * Mark a test as skipped.\n *\n * @api private\n * @return {Context} self\n */\nContext.prototype.skip = function() {\n this.runnable().skip();\n return this;\n};\n\n/**\n * Allow a number of retries on failed tests\n *\n * @api private\n * @param {number} n\n * @return {Context} self\n */\nContext.prototype.retries = function(n) {\n if (!arguments.length) {\n return this.runnable().retries();\n }\n this.runnable().retries(n);\n return this;\n};\n\n/**\n * Inspect the context void of `._runnable`.\n *\n * @api private\n * @return {string}\n */\nContext.prototype.inspect = function() {\n return JSON.stringify(this, function(key, val) {\n return key === 'runnable' || key === 'test' ? undefined : val;\n }, 2);\n};\n\n},{}],7:[function(require,module,exports){\n/**\n * Module dependencies.\n */\n\nvar Runnable = require('./runnable');\nvar inherits = require('./utils').inherits;\n\n/**\n * Expose `Hook`.\n */\n\nmodule.exports = Hook;\n\n/**\n * Initialize a new `Hook` with the given `title` and callback `fn`.\n *\n * @param {String} title\n * @param {Function} fn\n * @api private\n */\nfunction Hook(title, fn) {\n Runnable.call(this, title, fn);\n this.type = 'hook';\n}\n\n/**\n * Inherit from `Runnable.prototype`.\n */\ninherits(Hook, Runnable);\n\n/**\n * Get or set the test `err`.\n *\n * @param {Error} err\n * @return {Error}\n * @api public\n */\nHook.prototype.error = function(err) {\n if (!arguments.length) {\n err = this._error;\n this._error = null;\n return err;\n }\n\n this._error = err;\n};\n\n},{\"./runnable\":35,\"./utils\":39}],8:[function(require,module,exports){\n/**\n * Module dependencies.\n */\n\nvar Suite = require('../suite');\nvar Test = require('../test');\nvar escapeRe = require('escape-string-regexp');\n\n/**\n * BDD-style interface:\n *\n * describe('Array', function() {\n * describe('#indexOf()', function() {\n * it('should return -1 when not present', function() {\n * // ...\n * });\n *\n * it('should return the index when present', function() {\n * // ...\n * });\n * });\n * });\n *\n * @param {Suite} suite Root suite.\n */\nmodule.exports = function(suite) {\n var suites = [suite];\n\n suite.on('pre-require', function(context, file, mocha) {\n var common = require('./common')(suites, context);\n\n context.before = common.before;\n context.after = common.after;\n context.beforeEach = common.beforeEach;\n context.afterEach = common.afterEach;\n context.run = mocha.options.delay && common.runWithSuite(suite);\n /**\n * Describe a \"suite\" with the given `title`\n * and callback `fn` containing nested suites\n * and/or tests.\n */\n\n context.describe = context.context = function(title, fn) {\n var suite = Suite.create(suites[0], title);\n suite.file = file;\n suites.unshift(suite);\n fn.call(suite);\n suites.shift();\n return suite;\n };\n\n /**\n * Pending describe.\n */\n\n context.xdescribe = context.xcontext = context.describe.skip = function(title, fn) {\n var suite = Suite.create(suites[0], title);\n suite.pending = true;\n suites.unshift(suite);\n fn.call(suite);\n suites.shift();\n };\n\n /**\n * Exclusive suite.\n */\n\n context.describe.only = function(title, fn) {\n var suite = context.describe(title, fn);\n mocha.grep(suite.fullTitle());\n return suite;\n };\n\n /**\n * Describe a specification or test-case\n * with the given `title` and callback `fn`\n * acting as a thunk.\n */\n\n var it = context.it = context.specify = function(title, fn) {\n var suite = suites[0];\n if (suite.pending) {\n fn = null;\n }\n var test = new Test(title, fn);\n test.file = file;\n suite.addTest(test);\n return test;\n };\n\n /**\n * Exclusive test-case.\n */\n\n context.it.only = function(title, fn) {\n var test = it(title, fn);\n var reString = '^' + escapeRe(test.fullTitle()) + '$';\n mocha.grep(new RegExp(reString));\n return test;\n };\n\n /**\n * Pending test case.\n */\n\n context.xit = context.xspecify = context.it.skip = function(title) {\n context.it(title);\n };\n\n /**\n * Number of attempts to retry.\n */\n context.it.retries = function(n) {\n context.retries(n);\n };\n });\n};\n\n},{\"../suite\":37,\"../test\":38,\"./common\":9,\"escape-string-regexp\":68}],9:[function(require,module,exports){\n'use strict';\n\n/**\n * Functions common to more than one interface.\n *\n * @param {Suite[]} suites\n * @param {Context} context\n * @return {Object} An object containing common functions.\n */\nmodule.exports = function(suites, context) {\n return {\n /**\n * This is only present if flag --delay is passed into Mocha. It triggers\n * root suite execution.\n *\n * @param {Suite} suite The root wuite.\n * @return {Function} A function which runs the root suite\n */\n runWithSuite: function runWithSuite(suite) {\n return function run() {\n suite.run();\n };\n },\n\n /**\n * Execute before running tests.\n *\n * @param {string} name\n * @param {Function} fn\n */\n before: function(name, fn) {\n suites[0].beforeAll(name, fn);\n },\n\n /**\n * Execute after running tests.\n *\n * @param {string} name\n * @param {Function} fn\n */\n after: function(name, fn) {\n suites[0].afterAll(name, fn);\n },\n\n /**\n * Execute before each test case.\n *\n * @param {string} name\n * @param {Function} fn\n */\n beforeEach: function(name, fn) {\n suites[0].beforeEach(name, fn);\n },\n\n /**\n * Execute after each test case.\n *\n * @param {string} name\n * @param {Function} fn\n */\n afterEach: function(name, fn) {\n suites[0].afterEach(name, fn);\n },\n\n test: {\n /**\n * Pending test case.\n *\n * @param {string} title\n */\n skip: function(title) {\n context.test(title);\n },\n\n /**\n * Number of retry attempts\n *\n * @param {string} n\n */\n retries: function(n) {\n context.retries(n);\n }\n }\n };\n};\n\n},{}],10:[function(require,module,exports){\n/**\n * Module dependencies.\n */\n\nvar Suite = require('../suite');\nvar Test = require('../test');\n\n/**\n * TDD-style interface:\n *\n * exports.Array = {\n * '#indexOf()': {\n * 'should return -1 when the value is not present': function() {\n *\n * },\n *\n * 'should return the correct index when the value is present': function() {\n *\n * }\n * }\n * };\n *\n * @param {Suite} suite Root suite.\n */\nmodule.exports = function(suite) {\n var suites = [suite];\n\n suite.on('require', visit);\n\n function visit(obj, file) {\n var suite;\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n var fn = obj[key];\n switch (key) {\n case 'before':\n suites[0].beforeAll(fn);\n break;\n case 'after':\n suites[0].afterAll(fn);\n break;\n case 'beforeEach':\n suites[0].beforeEach(fn);\n break;\n case 'afterEach':\n suites[0].afterEach(fn);\n break;\n default:\n var test = new Test(key, fn);\n test.file = file;\n suites[0].addTest(test);\n }\n } else {\n suite = Suite.create(suites[0], key);\n suites.unshift(suite);\n visit(obj[key], file);\n suites.shift();\n }\n }\n }\n};\n\n},{\"../suite\":37,\"../test\":38}],11:[function(require,module,exports){\nexports.bdd = require('./bdd');\nexports.tdd = require('./tdd');\nexports.qunit = require('./qunit');\nexports.exports = require('./exports');\n\n},{\"./bdd\":8,\"./exports\":10,\"./qunit\":12,\"./tdd\":13}],12:[function(require,module,exports){\n/**\n * Module dependencies.\n */\n\nvar Suite = require('../suite');\nvar Test = require('../test');\nvar escapeRe = require('escape-string-regexp');\n\n/**\n * QUnit-style interface:\n *\n * suite('Array');\n *\n * test('#length', function() {\n * var arr = [1,2,3];\n * ok(arr.length == 3);\n * });\n *\n * test('#indexOf()', function() {\n * var arr = [1,2,3];\n * ok(arr.indexOf(1) == 0);\n * ok(arr.indexOf(2) == 1);\n * ok(arr.indexOf(3) == 2);\n * });\n *\n * suite('String');\n *\n * test('#length', function() {\n * ok('foo'.length == 3);\n * });\n *\n * @param {Suite} suite Root suite.\n */\nmodule.exports = function(suite) {\n var suites = [suite];\n\n suite.on('pre-require', function(context, file, mocha) {\n var common = require('./common')(suites, context);\n\n context.before = common.before;\n context.after = common.after;\n context.beforeEach = common.beforeEach;\n context.afterEach = common.afterEach;\n context.run = mocha.options.delay && common.runWithSuite(suite);\n /**\n * Describe a \"suite\" with the given `title`.\n */\n\n context.suite = function(title) {\n if (suites.length > 1) {\n suites.shift();\n }\n var suite = Suite.create(suites[0], title);\n suite.file = file;\n suites.unshift(suite);\n return suite;\n };\n\n /**\n * Exclusive test-case.\n */\n\n context.suite.only = function(title, fn) {\n var suite = context.suite(title, fn);\n mocha.grep(suite.fullTitle());\n };\n\n /**\n * Describe a specification or test-case\n * with the given `title` and callback `fn`\n * acting as a thunk.\n */\n\n context.test = function(title, fn) {\n var test = new Test(title, fn);\n test.file = file;\n suites[0].addTest(test);\n return test;\n };\n\n /**\n * Exclusive test-case.\n */\n\n context.test.only = function(title, fn) {\n var test = context.test(title, fn);\n var reString = '^' + escapeRe(test.fullTitle()) + '$';\n mocha.grep(new RegExp(reString));\n };\n\n context.test.skip = common.test.skip;\n context.test.retries = common.test.retries;\n });\n};\n\n},{\"../suite\":37,\"../test\":38,\"./common\":9,\"escape-string-regexp\":68}],13:[function(require,module,exports){\n/**\n * Module dependencies.\n */\n\nvar Suite = require('../suite');\nvar Test = require('../test');\nvar escapeRe = require('escape-string-regexp');\n\n/**\n * TDD-style interface:\n *\n * suite('Array', function() {\n * suite('#indexOf()', function() {\n * suiteSetup(function() {\n *\n * });\n *\n * test('should return -1 when not present', function() {\n *\n * });\n *\n * test('should return the index when present', function() {\n *\n * });\n *\n * suiteTeardown(function() {\n *\n * });\n * });\n * });\n *\n * @param {Suite} suite Root suite.\n */\nmodule.exports = function(suite) {\n var suites = [suite];\n\n suite.on('pre-require', function(context, file, mocha) {\n var common = require('./common')(suites, context);\n\n context.setup = common.beforeEach;\n context.teardown = common.afterEach;\n context.suiteSetup = common.before;\n context.suiteTeardown = common.after;\n context.run = mocha.options.delay && common.runWithSuite(suite);\n\n /**\n * Describe a \"suite\" with the given `title` and callback `fn` containing\n * nested suites and/or tests.\n */\n context.suite = function(title, fn) {\n var suite = Suite.create(suites[0], title);\n suite.file = file;\n suites.unshift(suite);\n fn.call(suite);\n suites.shift();\n return suite;\n };\n\n /**\n * Pending suite.\n */\n context.suite.skip = function(title, fn) {\n var suite = Suite.create(suites[0], title);\n suite.pending = true;\n suites.unshift(suite);\n fn.call(suite);\n suites.shift();\n };\n\n /**\n * Exclusive test-case.\n */\n context.suite.only = function(title, fn) {\n var suite = context.suite(title, fn);\n mocha.grep(suite.fullTitle());\n };\n\n /**\n * Describe a specification or test-case with the given `title` and\n * callback `fn` acting as a thunk.\n */\n context.test = function(title, fn) {\n var suite = suites[0];\n if (suite.pending) {\n fn = null;\n }\n var test = new Test(title, fn);\n test.file = file;\n suite.addTest(test);\n return test;\n };\n\n /**\n * Exclusive test-case.\n */\n\n context.test.only = function(title, fn) {\n var test = context.test(title, fn);\n var reString = '^' + escapeRe(test.fullTitle()) + '$';\n mocha.grep(new RegExp(reString));\n };\n\n context.test.skip = common.test.skip;\n context.test.retries = common.test.retries;\n });\n};\n\n},{\"../suite\":37,\"../test\":38,\"./common\":9,\"escape-string-regexp\":68}],14:[function(require,module,exports){\n(function (process,global,__dirname){\n/*!\n * mocha\n * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\nvar escapeRe = require('escape-string-regexp');\nvar path = require('path');\nvar reporters = require('./reporters');\nvar utils = require('./utils');\n\n/**\n * Expose `Mocha`.\n */\n\nexports = module.exports = Mocha;\n\n/**\n * To require local UIs and reporters when running in node.\n */\n\nif (!process.browser) {\n var cwd = process.cwd();\n module.paths.push(cwd, path.join(cwd, 'node_modules'));\n}\n\n/**\n * Expose internals.\n */\n\nexports.utils = utils;\nexports.interfaces = require('./interfaces');\nexports.reporters = reporters;\nexports.Runnable = require('./runnable');\nexports.Context = require('./context');\nexports.Runner = require('./runner');\nexports.Suite = require('./suite');\nexports.Hook = require('./hook');\nexports.Test = require('./test');\n\n/**\n * Return image `name` path.\n *\n * @api private\n * @param {string} name\n * @return {string}\n */\nfunction image(name) {\n return path.join(__dirname, '../images', name + '.png');\n}\n\n/**\n * Set up mocha with `options`.\n *\n * Options:\n *\n * - `ui` name \"bdd\", \"tdd\", \"exports\" etc\n * - `reporter` reporter instance, defaults to `mocha.reporters.spec`\n * - `globals` array of accepted globals\n * - `timeout` timeout in milliseconds\n * - `retries` number of times to retry failed tests\n * - `bail` bail on the first test failure\n * - `slow` milliseconds to wait before considering a test slow\n * - `ignoreLeaks` ignore global leaks\n * - `fullTrace` display the full stack-trace on failing\n * - `grep` string or regexp to filter tests with\n *\n * @param {Object} options\n * @api public\n */\nfunction Mocha(options) {\n options = options || {};\n this.files = [];\n this.options = options;\n if (options.grep) {\n this.grep(new RegExp(options.grep));\n }\n if (options.fgrep) {\n this.grep(options.fgrep);\n }\n this.suite = new exports.Suite('', new exports.Context());\n this.ui(options.ui);\n this.bail(options.bail);\n this.reporter(options.reporter, options.reporterOptions);\n if (typeof options.timeout !== 'undefined' && options.timeout !== null) {\n this.timeout(options.timeout);\n }\n if (typeof options.retries !== 'undefined' && options.retries !== null) {\n this.retries(options.retries);\n }\n this.useColors(options.useColors);\n if (options.enableTimeouts !== null) {\n this.enableTimeouts(options.enableTimeouts);\n }\n if (options.slow) {\n this.slow(options.slow);\n }\n\n this.suite.on('pre-require', function(context) {\n exports.afterEach = context.afterEach || context.teardown;\n exports.after = context.after || context.suiteTeardown;\n exports.beforeEach = context.beforeEach || context.setup;\n exports.before = context.before || context.suiteSetup;\n exports.describe = context.describe || context.suite;\n exports.it = context.it || context.test;\n exports.setup = context.setup || context.beforeEach;\n exports.suiteSetup = context.suiteSetup || context.before;\n exports.suiteTeardown = context.suiteTeardown || context.after;\n exports.suite = context.suite || context.describe;\n exports.teardown = context.teardown || context.afterEach;\n exports.test = context.test || context.it;\n exports.run = context.run;\n });\n}\n\n/**\n * Enable or disable bailing on the first failure.\n *\n * @api public\n * @param {boolean} [bail]\n */\nMocha.prototype.bail = function(bail) {\n if (!arguments.length) {\n bail = true;\n }\n this.suite.bail(bail);\n return this;\n};\n\n/**\n * Add test `file`.\n *\n * @api public\n * @param {string} file\n */\nMocha.prototype.addFile = function(file) {\n this.files.push(file);\n return this;\n};\n\n/**\n * Set reporter to `reporter`, defaults to \"spec\".\n *\n * @param {String|Function} reporter name or constructor\n * @param {Object} reporterOptions optional options\n * @api public\n * @param {string|Function} reporter name or constructor\n * @param {Object} reporterOptions optional options\n */\nMocha.prototype.reporter = function(reporter, reporterOptions) {\n if (typeof reporter === 'function') {\n this._reporter = reporter;\n } else {\n reporter = reporter || 'spec';\n var _reporter;\n // Try to load a built-in reporter.\n if (reporters[reporter]) {\n _reporter = reporters[reporter];\n }\n // Try to load reporters from process.cwd() and node_modules\n if (!_reporter) {\n try {\n _reporter = require(reporter);\n } catch (err) {\n err.message.indexOf('Cannot find module') !== -1\n ? console.warn('\"' + reporter + '\" reporter not found')\n : console.warn('\"' + reporter + '\" reporter blew up with error:\\n' + err.stack);\n }\n }\n if (!_reporter && reporter === 'teamcity') {\n console.warn('The Teamcity reporter was moved to a package named '\n + 'mocha-teamcity-reporter '\n + '(https://npmjs.org/package/mocha-teamcity-reporter).');\n }\n if (!_reporter) {\n throw new Error('invalid reporter \"' + reporter + '\"');\n }\n this._reporter = _reporter;\n }\n this.options.reporterOptions = reporterOptions;\n return this;\n};\n\n/**\n * Set test UI `name`, defaults to \"bdd\".\n *\n * @api public\n * @param {string} bdd\n */\nMocha.prototype.ui = function(name) {\n name = name || 'bdd';\n this._ui = exports.interfaces[name];\n if (!this._ui) {\n try {\n this._ui = require(name);\n } catch (err) {\n throw new Error('invalid interface \"' + name + '\"');\n }\n }\n this._ui = this._ui(this.suite);\n return this;\n};\n\n/**\n * Load registered files.\n *\n * @api private\n */\nMocha.prototype.loadFiles = function(fn) {\n var self = this;\n var suite = this.suite;\n this.files.forEach(function(file) {\n file = path.resolve(file);\n suite.emit('pre-require', global, file, self);\n suite.emit('require', require(file), file, self);\n suite.emit('post-require', global, file, self);\n });\n fn && fn();\n};\n\n/**\n * Enable growl support.\n *\n * @api private\n */\nMocha.prototype._growl = function(runner, reporter) {\n var notify = require('growl');\n\n runner.on('end', function() {\n var stats = reporter.stats;\n if (stats.failures) {\n var msg = stats.failures + ' of ' + runner.total + ' tests failed';\n notify(msg, { name: 'mocha', title: 'Failed', image: image('error') });\n } else {\n notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', {\n name: 'mocha',\n title: 'Passed',\n image: image('ok')\n });\n }\n });\n};\n\n/**\n * Add regexp to grep, if `re` is a string it is escaped.\n *\n * @param {RegExp|String} re\n * @return {Mocha}\n * @api public\n * @param {RegExp|string} re\n * @return {Mocha}\n */\nMocha.prototype.grep = function(re) {\n this.options.grep = typeof re === 'string' ? new RegExp(escapeRe(re)) : re;\n return this;\n};\n\n/**\n * Invert `.grep()` matches.\n *\n * @return {Mocha}\n * @api public\n */\nMocha.prototype.invert = function() {\n this.options.invert = true;\n return this;\n};\n\n/**\n * Ignore global leaks.\n *\n * @param {Boolean} ignore\n * @return {Mocha}\n * @api public\n * @param {boolean} ignore\n * @return {Mocha}\n */\nMocha.prototype.ignoreLeaks = function(ignore) {\n this.options.ignoreLeaks = Boolean(ignore);\n return this;\n};\n\n/**\n * Enable global leak checking.\n *\n * @return {Mocha}\n * @api public\n */\nMocha.prototype.checkLeaks = function() {\n this.options.ignoreLeaks = false;\n return this;\n};\n\n/**\n * Display long stack-trace on failing\n *\n * @return {Mocha}\n * @api public\n */\nMocha.prototype.fullTrace = function() {\n this.options.fullStackTrace = true;\n return this;\n};\n\n/**\n * Enable growl support.\n *\n * @return {Mocha}\n * @api public\n */\nMocha.prototype.growl = function() {\n this.options.growl = true;\n return this;\n};\n\n/**\n * Ignore `globals` array or string.\n *\n * @param {Array|String} globals\n * @return {Mocha}\n * @api public\n * @param {Array|string} globals\n * @return {Mocha}\n */\nMocha.prototype.globals = function(globals) {\n this.options.globals = (this.options.globals || []).concat(globals);\n return this;\n};\n\n/**\n * Emit color output.\n *\n * @param {Boolean} colors\n * @return {Mocha}\n * @api public\n * @param {boolean} colors\n * @return {Mocha}\n */\nMocha.prototype.useColors = function(colors) {\n if (colors !== undefined) {\n this.options.useColors = colors;\n }\n return this;\n};\n\n/**\n * Use inline diffs rather than +/-.\n *\n * @param {Boolean} inlineDiffs\n * @return {Mocha}\n * @api public\n * @param {boolean} inlineDiffs\n * @return {Mocha}\n */\nMocha.prototype.useInlineDiffs = function(inlineDiffs) {\n this.options.useInlineDiffs = inlineDiffs !== undefined && inlineDiffs;\n return this;\n};\n\n/**\n * Set the timeout in milliseconds.\n *\n * @param {Number} timeout\n * @return {Mocha}\n * @api public\n * @param {number} timeout\n * @return {Mocha}\n */\nMocha.prototype.timeout = function(timeout) {\n this.suite.timeout(timeout);\n return this;\n};\n\n/**\n * Set the number of times to retry failed tests.\n *\n * @param {Number} retry times\n * @return {Mocha}\n * @api public\n */\nMocha.prototype.retries = function(n) {\n this.suite.retries(n);\n return this;\n};\n\n/**\n * Set slowness threshold in milliseconds.\n *\n * @param {Number} slow\n * @return {Mocha}\n * @api public\n * @param {number} slow\n * @return {Mocha}\n */\nMocha.prototype.slow = function(slow) {\n this.suite.slow(slow);\n return this;\n};\n\n/**\n * Enable timeouts.\n *\n * @param {Boolean} enabled\n * @return {Mocha}\n * @api public\n * @param {boolean} enabled\n * @return {Mocha}\n */\nMocha.prototype.enableTimeouts = function(enabled) {\n this.suite.enableTimeouts(arguments.length && enabled !== undefined ? enabled : true);\n return this;\n};\n\n/**\n * Makes all tests async (accepting a callback)\n *\n * @return {Mocha}\n * @api public\n */\nMocha.prototype.asyncOnly = function() {\n this.options.asyncOnly = true;\n return this;\n};\n\n/**\n * Disable syntax highlighting (in browser).\n *\n * @api public\n */\nMocha.prototype.noHighlighting = function() {\n this.options.noHighlighting = true;\n return this;\n};\n\n/**\n * Enable uncaught errors to propagate (in browser).\n *\n * @return {Mocha}\n * @api public\n */\nMocha.prototype.allowUncaught = function() {\n this.options.allowUncaught = true;\n return this;\n};\n\n/**\n * Delay root suite execution.\n * @returns {Mocha}\n */\nMocha.prototype.delay = function delay() {\n this.options.delay = true;\n return this;\n};\n\n/**\n * Run tests and invoke `fn()` when complete.\n *\n * @api public\n * @param {Function} fn\n * @return {Runner}\n */\nMocha.prototype.run = function(fn) {\n if (this.files.length) {\n this.loadFiles();\n }\n var suite = this.suite;\n var options = this.options;\n options.files = this.files;\n var runner = new exports.Runner(suite, options.delay);\n var reporter = new this._reporter(runner, options);\n runner.ignoreLeaks = options.ignoreLeaks !== false;\n runner.fullStackTrace = options.fullStackTrace;\n runner.asyncOnly = options.asyncOnly;\n runner.allowUncaught = options.allowUncaught;\n if (options.grep) {\n runner.grep(options.grep, options.invert);\n }\n if (options.globals) {\n runner.globals(options.globals);\n }\n if (options.growl) {\n this._growl(runner, reporter);\n }\n if (options.useColors !== undefined) {\n exports.reporters.Base.useColors = options.useColors;\n }\n exports.reporters.Base.inlineDiffs = options.useInlineDiffs;\n\n function done(failures) {\n if (reporter.done) {\n reporter.done(failures, fn);\n } else {\n fn && fn(failures);\n }\n }\n\n return runner.run(done);\n};\n\n}).call(this,require('_process'),typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {},\"/lib\")\n},{\"./context\":6,\"./hook\":7,\"./interfaces\":11,\"./reporters\":22,\"./runnable\":35,\"./runner\":36,\"./suite\":37,\"./test\":38,\"./utils\":39,\"_process\":51,\"escape-string-regexp\":68,\"growl\":69,\"path\":41}],15:[function(require,module,exports){\n/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @api public\n * @param {string|number} val\n * @param {Object} options\n * @return {string|number}\n */\nmodule.exports = function(val, options) {\n options = options || {};\n if (typeof val === 'string') {\n return parse(val);\n }\n // https://github.com/mochajs/mocha/pull/1035\n return options['long'] ? longFormat(val) : shortFormat(val);\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @api private\n * @param {string} str\n * @return {number}\n */\nfunction parse(str) {\n var match = (/^((?:\\d+)?\\.?\\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i).exec(str);\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 's':