@vitest/expect 4.0.13 → 4.0.15
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 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -668,7 +668,7 @@ function getObjectSubset(object, subset, customTesters) {
|
|
|
668
668
|
* Detects if an object is a Standard Schema V1 compatible schema
|
|
669
669
|
*/
|
|
670
670
|
function isStandardSchema(obj) {
|
|
671
|
-
return !!obj && typeof obj === "object" && obj["~standard"] && typeof obj["~standard"].validate === "function";
|
|
671
|
+
return !!obj && (typeof obj === "object" || typeof obj === "function") && obj["~standard"] && typeof obj["~standard"].validate === "function";
|
|
672
672
|
}
|
|
673
673
|
|
|
674
674
|
if (!Object.hasOwn(globalThis, MATCHERS_OBJECT)) {
|
|
@@ -1769,12 +1769,14 @@ function getMatcherState(assertion, expect) {
|
|
|
1769
1769
|
subsetEquality
|
|
1770
1770
|
};
|
|
1771
1771
|
let task = util.flag(assertion, "vitest-test");
|
|
1772
|
+
const currentTestName = (task === null || task === void 0 ? void 0 : task.fullTestName) ?? "";
|
|
1772
1773
|
if ((task === null || task === void 0 ? void 0 : task.type) !== "test") {
|
|
1773
1774
|
task = undefined;
|
|
1774
1775
|
}
|
|
1775
1776
|
const matcherState = {
|
|
1776
1777
|
...getState(expect),
|
|
1777
1778
|
task,
|
|
1779
|
+
currentTestName,
|
|
1778
1780
|
customTesters: getCustomEqualityTesters(),
|
|
1779
1781
|
isNot,
|
|
1780
1782
|
utils: jestUtils,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest/expect",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.15",
|
|
5
5
|
"description": "Jest's expect matchers as a Chai plugin",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"@types/chai": "^5.2.2",
|
|
34
34
|
"chai": "^6.2.1",
|
|
35
35
|
"tinyrainbow": "^3.0.3",
|
|
36
|
-
"@vitest/spy": "4.0.
|
|
37
|
-
"@vitest/utils": "4.0.
|
|
36
|
+
"@vitest/spy": "4.0.15",
|
|
37
|
+
"@vitest/utils": "4.0.15"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@vitest/runner": "4.0.
|
|
40
|
+
"@vitest/runner": "4.0.15"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "premove dist && rollup -c",
|