mirror of
https://github.com/chaijs/chai
synced 2024-11-15 00:07:11 +00:00
moved fail to primary export
This commit is contained in:
parent
84734b43cc
commit
0a2fc7671a
2 changed files with 14 additions and 12 deletions
10
lib/chai.js
10
lib/chai.js
|
@ -13,3 +13,13 @@ exports.should = require('./interface/should');
|
|||
|
||||
exports.Assertion = require('./assertion');
|
||||
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
|
||||
});
|
||||
}
|
12
lib/error.js
12
lib/error.js
|
@ -1,4 +1,6 @@
|
|||
|
||||
var fail = require('./chai').fail;
|
||||
|
||||
module.exports = AssertionError;
|
||||
|
||||
function AssertionError (options) {
|
||||
|
@ -28,13 +30,3 @@ 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
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue