Sha256: ec33efd712a6e84390f8c3d3d06ab96e8ff113ccfc49049f8bfdc8d019993639

Contents?: true

Size: 1.15 KB

Versions: 15

Compression:

Stored size: 1.15 KB

Contents

/*!
 * chai
 * Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
 * MIT Licensed
 */

/*!
 * Main export
 */

module.exports = AssertionError;

/**
 * # AssertionError (constructor)
 *
 * Create a new assertion error based on the Javascript
 * `Error` prototype.
 *
 * **Options**
 * - message
 * - actual
 * - expected
 * - operator
 * - startStackFunction
 *
 * @param {Object} options
 * @api public
 */

function AssertionError (options) {
  options = options || {};
  this.message = options.message;
  this.actual = options.actual;
  this.expected = options.expected;
  this.operator = options.operator;
  this.showDiff = options.showDiff;

  if (options.stackStartFunction && Error.captureStackTrace) {
    var stackStartFunction = options.stackStartFunction;
    Error.captureStackTrace(this, stackStartFunction);
  }
}

/*!
 * Inherit from Error
 */

AssertionError.prototype = Object.create(Error.prototype);
AssertionError.prototype.name = 'AssertionError';
AssertionError.prototype.constructor = AssertionError;

/**
 * # toString()
 *
 * Override default to string method
 */

AssertionError.prototype.toString = function() {
  return this.message;
};

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ende-0.4.25 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.24 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.23 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.22 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.21 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.15 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.14 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.13 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.12 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.11 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.10 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.9 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.8 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.7 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js
ende-0.4.6 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/error.js