From 0a2fc7671af1e894b9a168f9e001365f0aeaf240 Mon Sep 17 00:00:00 2001 From: Jake Luer Date: Thu, 15 Dec 2011 05:54:23 -0500 Subject: [PATCH] moved fail to primary export --- lib/chai.js | 12 +++++++++++- lib/error.js | 14 +++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/chai.js b/lib/chai.js index 4df86da..423fc30 100644 --- a/lib/chai.js +++ b/lib/chai.js @@ -12,4 +12,14 @@ exports.should = require('./interface/should'); exports.Assertion = require('./assertion'); -exports.AssertionError = require('./error'); \ No newline at end of file +exports.AssertionError = require('./error'); + +exports.fail = function (actual, expected, message, operator, stackStartFunction) { + throw new exports.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); +} \ No newline at end of file diff --git a/lib/error.js b/lib/error.js index ffa07eb..14c3ac4 100644 --- a/lib/error.js +++ b/lib/error.js @@ -1,4 +1,6 @@ +var fail = require('./chai').fail; + module.exports = AssertionError; function AssertionError (options) { @@ -27,14 +29,4 @@ AssertionError.prototype.details = function() { AssertionError.prototype.toString = function() { return this.summary(); -}; - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} \ No newline at end of file +}; \ No newline at end of file