chai 4.1.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +2 -2
- package/LICENSE +1 -1
- package/README.md +6 -6
- package/chai.js +635 -782
- package/index.mjs +13 -0
- package/karma.conf.js +7 -1
- package/karma.sauce.js +1 -1
- package/lib/chai/assertion.js +12 -2
- package/lib/chai/config.js +1 -1
- package/lib/chai/core/assertions.js +267 -162
- package/lib/chai/interface/assert.js +74 -59
- package/lib/chai/interface/expect.js +13 -0
- package/lib/chai/interface/should.js +16 -1
- package/lib/chai/utils/addLengthGuard.js +0 -2
- package/lib/chai/utils/addProperty.js +1 -1
- package/lib/chai/utils/compareByInspect.js +2 -2
- package/lib/chai/utils/getMessage.js +1 -2
- package/lib/chai/utils/getOperator.js +55 -0
- package/lib/chai/utils/getOwnEnumerableProperties.js +1 -1
- package/lib/chai/utils/index.js +6 -0
- package/lib/chai/utils/inspect.js +1 -8
- package/lib/chai/utils/isProxyEnabled.js +1 -1
- package/lib/chai/utils/objDisplay.js +1 -1
- package/lib/chai/utils/overwriteChainableMethod.js +1 -1
- package/lib/chai/utils/overwriteMethod.js +1 -1
- package/lib/chai/utils/overwriteProperty.js +1 -1
- package/lib/chai/utils/proxify.js +54 -32
- package/lib/chai/utils/test.js +1 -1
- package/lib/chai/utils/transferFlags.js +1 -1
- package/lib/chai.js +1 -1
- package/package.json +20 -12
- package/sauce.browsers.js +0 -9
- package/.npmignore +0 -14
package/index.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import chai from './index.js';
|
|
2
|
+
|
|
3
|
+
export const expect = chai.expect;
|
|
4
|
+
export const version = chai.version;
|
|
5
|
+
export const AssertionError = chai.AssertionError;
|
|
6
|
+
export const util = chai.util;
|
|
7
|
+
export const config = chai.config;
|
|
8
|
+
export const use = chai.use;
|
|
9
|
+
export const should = chai.should;
|
|
10
|
+
export const assert = chai.assert;
|
|
11
|
+
export const core = chai.core;
|
|
12
|
+
|
|
13
|
+
export default chai;
|
package/karma.conf.js
CHANGED
|
@@ -10,7 +10,13 @@ module.exports = function(config) {
|
|
|
10
10
|
, colors: true
|
|
11
11
|
, logLevel: config.LOG_INFO
|
|
12
12
|
, autoWatch: false
|
|
13
|
-
, browsers: [ '
|
|
13
|
+
, browsers: [ 'HeadlessChrome' ]
|
|
14
|
+
, customLaunchers: {
|
|
15
|
+
HeadlessChrome: {
|
|
16
|
+
base: 'ChromeHeadless'
|
|
17
|
+
, flags: [ '--no-sandbox',]
|
|
18
|
+
, }
|
|
19
|
+
, }
|
|
14
20
|
, browserDisconnectTimeout: 10000
|
|
15
21
|
, browserDisconnectTolerance: 2
|
|
16
22
|
, browserNoActivityTimeout: 20000
|
package/karma.sauce.js
CHANGED
|
@@ -26,7 +26,7 @@ module.exports = function(config) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
config.browsers = config.browsers.concat(browsers);
|
|
29
|
-
config.customLaunchers
|
|
29
|
+
Object.assign(config.customLaunchers, browserConfig);
|
|
30
30
|
config.reporters.push('saucelabs');
|
|
31
31
|
config.captureTimeout = 300000;
|
|
32
32
|
|
package/lib/chai/assertion.js
CHANGED
|
@@ -138,11 +138,21 @@ module.exports = function (_chai, util) {
|
|
|
138
138
|
if (!ok) {
|
|
139
139
|
msg = util.getMessage(this, arguments);
|
|
140
140
|
var actual = util.getActual(this, arguments);
|
|
141
|
-
|
|
141
|
+
var assertionErrorObjectProperties = {
|
|
142
142
|
actual: actual
|
|
143
143
|
, expected: expected
|
|
144
144
|
, showDiff: showDiff
|
|
145
|
-
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
var operator = util.getOperator(this, arguments);
|
|
148
|
+
if (operator) {
|
|
149
|
+
assertionErrorObjectProperties.operator = operator;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
throw new AssertionError(
|
|
153
|
+
msg,
|
|
154
|
+
assertionErrorObjectProperties,
|
|
155
|
+
(config.includeStack) ? this.assert : flag(this, 'ssfi'));
|
|
146
156
|
}
|
|
147
157
|
};
|
|
148
158
|
|
package/lib/chai/config.js
CHANGED