Sha256: 443f4d78803439b78e73582957035be638cd25a9a93596696b244e392312f6b6

Contents?: true

Size: 1.08 KB

Versions: 31

Compression:

Stored size: 1.08 KB

Contents

/**
 * Expose `Context`.
 */

module.exports = Context;

/**
 * Initialize a new `Context`.
 *
 * @api private
 */

function Context(){}

/**
 * Set or get the context `Runnable` to `runnable`.
 *
 * @param {Runnable} runnable
 * @return {Context}
 * @api private
 */

Context.prototype.runnable = function(runnable){
  if (0 == arguments.length) return this._runnable;
  this.test = 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;
};

/**
 * Set test slowness threshold `ms`.
 *
 * @param {Number} ms
 * @return {Context} self
 * @api private
 */

Context.prototype.slow = function(ms){
  this.runnable().slow(ms);
  return this;
};

/**
 * Inspect the context void of `._runnable`.
 *
 * @return {String}
 * @api private
 */

Context.prototype.inspect = function(){
  return JSON.stringify(this, function(key, val){
    if ('_runnable' == key) return;
    if ('test' == key) return;
    return val;
  }, 2);
};

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
stylus-source-0.35.1 vendor/node_modules/mocha/lib/context.js
stylus-source-0.35.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.34.1 vendor/node_modules/mocha/lib/context.js
stylus-source-0.34.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.33.1 vendor/node_modules/mocha/lib/context.js
stylus-source-0.33.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.32.1 vendor/node_modules/mocha/lib/context.js
stylus-source-0.32.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.31.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.30.1 vendor/node_modules/mocha/lib/context.js
stylus-source-0.30.0 vendor/node_modules/mocha/lib/context.js