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.42.2 vendor/node_modules/mocha/lib/context.js
stylus-source-0.42.1 vendor/node_modules/mocha/lib/context.js
stylus-source-0.42.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.41.3 vendor/node_modules/mocha/lib/context.js
stylus-source-0.41.2 vendor/node_modules/mocha/lib/context.js
stylus-source-0.41.1 vendor/node_modules/mocha/lib/context.js
stylus-source-0.41.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.40.3 vendor/node_modules/mocha/lib/context.js
stylus-source-0.40.2 vendor/node_modules/mocha/lib/context.js
stylus-source-0.40.1 vendor/node_modules/mocha/lib/context.js
stylus-source-0.40.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.39.4 vendor/node_modules/mocha/lib/context.js
stylus-source-0.39.3 vendor/node_modules/mocha/lib/context.js
stylus-source-0.39.2 vendor/node_modules/mocha/lib/context.js
stylus-source-0.39.1 vendor/node_modules/mocha/lib/context.js
stylus-source-0.39.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.38.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.37.0 vendor/node_modules/mocha/lib/context.js
stylus-source-0.36.1 vendor/node_modules/mocha/lib/context.js
stylus-source-0.36.0 vendor/node_modules/mocha/lib/context.js