diff options
Diffstat (limited to 'node_modules/mocha/lib/context.js')
| -rw-r--r-- | node_modules/mocha/lib/context.js | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/node_modules/mocha/lib/context.js b/node_modules/mocha/lib/context.js new file mode 100644 index 0000000..f636f1b --- /dev/null +++ b/node_modules/mocha/lib/context.js @@ -0,0 +1,55 @@ + +/** + * Expose `Context`. + */ + +module.exports = Context; + +/** + * Initialize a new `Context`. + * + * @api private + */ + +function Context(){} + +/** + * Set the context `Runnable` to `runnable`. + * + * @param {Runnable} runnable + * @return {Context} + * @api private + */ + +Context.prototype.runnable = function(runnable){ + this._runnable = runnable; + return this; +}; + +/** + * Set test timeout `ms`. + * + * @param {Number} ms + * @return {Context} self + * @api private + */ + +Context.prototype.timeout = function(ms){ + this._runnable.timeout(ms); + return this; +}; + +/** + * Inspect the context void of `._runnable`. + * + * @return {String} + * @api private + */ + +Context.prototype.inspect = function(){ + return JSON.stringify(this, function(key, val){ + return '_runnable' == key + ? undefined + : val; + }, 2); +}; |
