-
-
Notifications
You must be signed in to change notification settings - Fork 693
/
chai.js
65 lines (53 loc) · 1.24 KB
/
chai.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*!
* chai
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed
*/
import * as util from './chai/utils/index.js';
import {AssertionError} from 'assertion-error';
import {config} from './chai/config.js';
import './chai/core/assertions.js';
import {expect} from './chai/interface/expect.js';
import {Assertion} from './chai/assertion.js';
import * as should from './chai/interface/should.js';
import {assert} from './chai/interface/assert.js';
const used = [];
// Assertion Error
export {AssertionError};
/**
* # .use(function)
*
* Provides a way to extend the internals of Chai.
*
* @param {Function} fn
* @returns {this} for chaining
* @public
*/
export function use(fn) {
const exports = {
AssertionError,
util,
config,
expect,
assert,
Assertion,
...should
};
if (!~used.indexOf(fn)) {
fn(exports, util);
used.push(fn);
}
return exports;
};
// Utility Functions
export {util};
// Configuration
export {config};
// Primary `Assertion` prototype
export * from './chai/assertion.js';
// Expect interface
export * from './chai/interface/expect.js';
// Should interface
export * from './chai/interface/should.js';
// Assert interface
export * from './chai/interface/assert.js';