-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
32 lines (24 loc) · 676 Bytes
/
index.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
'use strict';
const empower = require('empower');
const formatter = require('power-assert-formatter');
const assert = require('./lib/assert');
const patterns = require('./lib/patterns');
const empowerOptions = {
modifyMessageOnRethrow: true,
saveContextOnRethrow: true,
patterns: patterns.ENHANCED,
wrapOnlyPatterns: patterns.NOT_ENHANCED,
};
function customize(options) {
options = options || {};
const powered = empower(
assert,
formatter(options.output),
Object.assign(empowerOptions, options.assertion),
);
powered.customize = customize;
return powered;
}
const clutch = customize();
clutch.default = clutch;
module.exports = clutch;