Sha256: 908679beb5c4a82e46da6e2b53484ecc5aa9568d497da171999827bca78364da

Contents?: true

Size: 715 Bytes

Versions: 8

Compression:

Stored size: 715 Bytes

Contents

/**
 * Module dependencies.
 */

var Runnable = require('./runnable');

/**
 * Expose `Hook`.
 */

module.exports = Hook;

/**
 * Initialize a new `Hook` with the given `title` and callback `fn`.
 *
 * @param {String} title
 * @param {Function} fn
 * @api private
 */

function Hook(title, fn) {
  Runnable.call(this, title, fn);
  this.type = 'hook';
}

/**
 * Inherit from `Runnable.prototype`.
 */

Hook.prototype.__proto__ = Runnable.prototype;

/**
 * Get or set the test `err`.
 *
 * @param {Error} err
 * @return {Error}
 * @api public
 */

Hook.prototype.error = function(err){
  if (0 == arguments.length) {
    var err = this._error;
    this._error = null;
    return err;
  }

  this._error = err;
};

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
stylus-source-0.31.0 vendor/node_modules/mocha/lib/hook.js
stylus-source-0.30.1 vendor/node_modules/mocha/lib/hook.js
stylus-source-0.30.0 vendor/node_modules/mocha/lib/hook.js
stylus-source-0.29.0 vendor/node_modules/mocha/lib/hook.js
stylus-source-0.28.2 vendor/node_modules/mocha/lib/hook.js
stylus-source-0.28.1 vendor/node_modules/mocha/lib/hook.js
stylus-source-0.28.0 vendor/node_modules/mocha/lib/hook.js
stylus-source-0.27.2 vendor/node_modules/mocha/lib/hook.js