mirror of
https://github.com/chaijs/chai
synced 2024-11-15 08:17:14 +00:00
43 lines
888 B
JavaScript
43 lines
888 B
JavaScript
/*!
|
|
* chai
|
|
* Copyright(c) 2011-2012 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
var used = [];
|
|
var exports = module.exports = {};
|
|
|
|
exports.version = '0.3.3';
|
|
|
|
exports.Assertion = require('./assertion');
|
|
exports.AssertionError = require('./error');
|
|
|
|
exports.inspect = require('./utils/inspect');
|
|
|
|
exports.use = function (fn) {
|
|
if (!~used.indexOf(fn)) {
|
|
fn(this);
|
|
used.push(fn);
|
|
}
|
|
|
|
return this;
|
|
};
|
|
|
|
exports.fail = function (actual, expected, message, operator, stackStartFunction) {
|
|
throw new exports.AssertionError({
|
|
message: message,
|
|
actual: actual,
|
|
expected: expected,
|
|
operator: operator,
|
|
stackStartFunction: stackStartFunction
|
|
});
|
|
};
|
|
|
|
var expect = require('./interface/expect');
|
|
exports.use(expect);
|
|
|
|
var should = require('./interface/should');
|
|
exports.use(should);
|
|
|
|
var assert = require('./interface/assert');
|
|
exports.use(assert);
|