@vitest/expect 4.1.5 → 5.0.0-beta.2
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/dist/index.js +3 -4
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { printDiffOrStringify, diff } from '@vitest/utils/diff';
|
|
2
|
-
import { stringify } from '@vitest/utils/display';
|
|
2
|
+
import { stringify, inspect } from '@vitest/utils/display';
|
|
3
3
|
import { getType, isObject, noop, assertTypes, ordinal } from '@vitest/utils/helpers';
|
|
4
4
|
import c from 'tinyrainbow';
|
|
5
5
|
import { isMockFunction } from '@vitest/spy';
|
|
@@ -1407,7 +1407,7 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
1407
1407
|
};
|
|
1408
1408
|
const { value, exists } = getValue();
|
|
1409
1409
|
const pass = exists && (args.length === 1 || equals(expected, value, customTesters));
|
|
1410
|
-
const valueString = args.length === 1 ? "" : ` with value ${
|
|
1410
|
+
const valueString = args.length === 1 ? "" : ` with value ${inspect(expected, { truncate: 40 })}`;
|
|
1411
1411
|
return this.assert(pass, `expected #{this} to have property "${propertyName}"${valueString}`, `expected #{this} to not have property "${propertyName}"${valueString}`, expected, exists ? value : undefined);
|
|
1412
1412
|
});
|
|
1413
1413
|
def("toBeCloseTo", function(received, precision = 2) {
|
|
@@ -1548,8 +1548,7 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
1548
1548
|
});
|
|
1549
1549
|
def(["toThrow", "toThrowError"], function(expected) {
|
|
1550
1550
|
if (typeof expected === "string" || typeof expected === "undefined" || expected instanceof RegExp) {
|
|
1551
|
-
|
|
1552
|
-
return this.throws(expected === "" ? /^$/ : expected);
|
|
1551
|
+
return this.throws(expected);
|
|
1553
1552
|
}
|
|
1554
1553
|
const obj = this._obj;
|
|
1555
1554
|
const promise = utils.flag(this, "promise");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest/expect",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0-beta.2",
|
|
5
5
|
"description": "Jest's expect matchers as a Chai plugin",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
|
@@ -23,10 +23,11 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
26
|
+
"__vitest_source__": "./src/index.ts",
|
|
26
27
|
"types": "./dist/index.d.ts",
|
|
27
28
|
"default": "./dist/index.js"
|
|
28
29
|
},
|
|
29
|
-
"
|
|
30
|
+
"./package.json": "./package.json"
|
|
30
31
|
},
|
|
31
32
|
"main": "./dist/index.js",
|
|
32
33
|
"module": "./dist/index.js",
|
|
@@ -39,11 +40,11 @@
|
|
|
39
40
|
"@types/chai": "^5.2.2",
|
|
40
41
|
"chai": "^6.2.2",
|
|
41
42
|
"tinyrainbow": "^3.1.0",
|
|
42
|
-
"@vitest/spy": "
|
|
43
|
-
"@vitest/utils": "
|
|
43
|
+
"@vitest/spy": "5.0.0-beta.2",
|
|
44
|
+
"@vitest/utils": "5.0.0-beta.2"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@vitest/runner": "
|
|
47
|
+
"@vitest/runner": "5.0.0-beta.2"
|
|
47
48
|
},
|
|
48
49
|
"scripts": {
|
|
49
50
|
"build": "premove dist && rollup -c",
|