UNPKG

1.26 kBJavaScriptView Raw
1/*!
2 * chai
3 * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
4 * MIT Licensed
5 */
6
7var used = [];
8
9/*!
10 * Chai version
11 */
12
13exports.version = '4.3.3';
14
15/*!
16 * Assertion Error
17 */
18
19exports.AssertionError = require('assertion-error');
20
21/*!
22 * Utils for plugins (not exported)
23 */
24
25var util = require('./chai/utils');
26
27/**
28 * # .use(function)
29 *
30 * Provides a way to extend the internals of Chai.
31 *
32 * @param {Function}
33 * @returns {this} for chaining
34 * @api public
35 */
36
37exports.use = function (fn) {
38 if (!~used.indexOf(fn)) {
39 fn(exports, util);
40 used.push(fn);
41 }
42
43 return exports;
44};
45
46/*!
47 * Utility Functions
48 */
49
50exports.util = util;
51
52/*!
53 * Configuration
54 */
55
56var config = require('./chai/config');
57exports.config = config;
58
59/*!
60 * Primary `Assertion` prototype
61 */
62
63var assertion = require('./chai/assertion');
64exports.use(assertion);
65
66/*!
67 * Core Assertions
68 */
69
70var core = require('./chai/core/assertions');
71exports.use(core);
72
73/*!
74 * Expect interface
75 */
76
77var expect = require('./chai/interface/expect');
78exports.use(expect);
79
80/*!
81 * Should interface
82 */
83
84var should = require('./chai/interface/should');
85exports.use(should);
86
87/*!
88 * Assert interface
89 */
90
91var assert = require('./chai/interface/assert');
92exports.use(assert);