2011-12-15 12:21:53 +00:00
|
|
|
/*!
|
|
|
|
* chai
|
2013-12-30 15:57:41 +00:00
|
|
|
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
|
2011-12-15 12:21:53 +00:00
|
|
|
* MIT Licensed
|
|
|
|
*/
|
2011-12-07 05:25:52 +00:00
|
|
|
|
2016-10-03 12:12:34 +00:00
|
|
|
var used = [];
|
2012-03-18 21:21:19 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* Chai version
|
|
|
|
*/
|
2011-12-07 05:25:52 +00:00
|
|
|
|
2018-09-26 09:39:58 +00:00
|
|
|
exports.version = '4.2.0';
|
2011-12-07 05:25:52 +00:00
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
/*!
|
|
|
|
* Assertion Error
|
|
|
|
*/
|
|
|
|
|
2013-06-17 19:27:50 +00:00
|
|
|
exports.AssertionError = require('assertion-error');
|
2011-12-15 10:54:23 +00:00
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
/*!
|
|
|
|
* Utils for plugins (not exported)
|
|
|
|
*/
|
|
|
|
|
2012-06-24 10:25:36 +00:00
|
|
|
var util = require('./chai/utils');
|
2012-03-18 21:21:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* # .use(function)
|
|
|
|
*
|
2016-10-08 13:41:36 +00:00
|
|
|
* Provides a way to extend the internals of Chai.
|
2012-03-18 21:21:19 +00:00
|
|
|
*
|
|
|
|
* @param {Function}
|
|
|
|
* @returns {this} for chaining
|
|
|
|
* @api public
|
|
|
|
*/
|
2012-01-27 00:13:41 +00:00
|
|
|
|
|
|
|
exports.use = function (fn) {
|
2012-02-07 21:09:38 +00:00
|
|
|
if (!~used.indexOf(fn)) {
|
2016-06-09 21:49:18 +00:00
|
|
|
fn(exports, util);
|
2012-02-06 16:38:14 +00:00
|
|
|
used.push(fn);
|
|
|
|
}
|
|
|
|
|
2016-06-09 21:49:18 +00:00
|
|
|
return exports;
|
2012-01-27 00:13:41 +00:00
|
|
|
};
|
|
|
|
|
2014-12-30 21:19:45 +00:00
|
|
|
/*!
|
|
|
|
* Utility Functions
|
|
|
|
*/
|
|
|
|
|
|
|
|
exports.util = util;
|
|
|
|
|
2014-03-17 14:48:17 +00:00
|
|
|
/*!
|
|
|
|
* Configuration
|
|
|
|
*/
|
|
|
|
|
|
|
|
var config = require('./chai/config');
|
|
|
|
exports.config = config;
|
|
|
|
|
2013-06-17 19:27:50 +00:00
|
|
|
/*!
|
|
|
|
* Primary `Assertion` prototype
|
|
|
|
*/
|
|
|
|
|
|
|
|
var assertion = require('./chai/assertion');
|
|
|
|
exports.use(assertion);
|
|
|
|
|
2012-06-24 11:06:26 +00:00
|
|
|
/*!
|
|
|
|
* Core Assertions
|
|
|
|
*/
|
|
|
|
|
|
|
|
var core = require('./chai/core/assertions');
|
|
|
|
exports.use(core);
|
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
/*!
|
|
|
|
* Expect interface
|
|
|
|
*/
|
|
|
|
|
2012-06-24 10:25:36 +00:00
|
|
|
var expect = require('./chai/interface/expect');
|
2012-01-27 00:14:08 +00:00
|
|
|
exports.use(expect);
|
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
/*!
|
|
|
|
* Should interface
|
|
|
|
*/
|
|
|
|
|
2012-06-24 10:25:36 +00:00
|
|
|
var should = require('./chai/interface/should');
|
2012-01-27 00:14:08 +00:00
|
|
|
exports.use(should);
|
|
|
|
|
2012-03-18 21:21:19 +00:00
|
|
|
/*!
|
|
|
|
* Assert interface
|
|
|
|
*/
|
|
|
|
|
2012-06-24 10:25:36 +00:00
|
|
|
var assert = require('./chai/interface/assert');
|
2012-01-27 00:14:08 +00:00
|
|
|
exports.use(assert);
|