mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
Upgrade test package to vitest 1.1.3
This commit is contained in:
parent
fe92180f2c
commit
023e86608b
@ -1,8 +1,8 @@
|
||||
diff --git a/dist/index.js b/dist/index.js
|
||||
index 5a61947ad50426d27390b4e82533179323ad3ba1..32bfc45909b645cb31cec2e204c8baa23f21fdd2 100644
|
||||
index 974d6b26f626024fc9904908100c9ecaa54f43e1..5be2d35267e7f0525c6588758dbebe72599f88a9 100644
|
||||
--- a/dist/index.js
|
||||
+++ b/dist/index.js
|
||||
@@ -6,23 +6,29 @@ import { processError } from '@vitest/utils/error';
|
||||
@@ -6,31 +6,37 @@ import { processError } from '@vitest/utils/error';
|
||||
import { util } from 'chai';
|
||||
|
||||
const MATCHERS_OBJECT = Symbol.for("matchers-object");
|
||||
@ -11,15 +11,19 @@ index 5a61947ad50426d27390b4e82533179323ad3ba1..32bfc45909b645cb31cec2e204c8baa2
|
||||
+// Otherwise, vitest will override global jest matchers, and crash.
|
||||
+const JEST_MATCHERS_OBJECT = Symbol.for("$$jest-matchers-object-storybook");
|
||||
const GLOBAL_EXPECT = Symbol.for("expect-global");
|
||||
const ASYMMETRIC_MATCHERS_OBJECT = Symbol.for("asymmetric-matchers-object");
|
||||
|
||||
if (!Object.prototype.hasOwnProperty.call(globalThis, MATCHERS_OBJECT)) {
|
||||
const globalState = /* @__PURE__ */ new WeakMap();
|
||||
- const matchers = /* @__PURE__ */ Object.create(null);
|
||||
const assymetricMatchers = /* @__PURE__ */ Object.create(null);
|
||||
Object.defineProperty(globalThis, MATCHERS_OBJECT, {
|
||||
get: () => globalState
|
||||
});
|
||||
+ Object.defineProperty(globalThis, ASYMMETRIC_MATCHERS_OBJECT, {
|
||||
+ get: () => assymetricMatchers
|
||||
+ });
|
||||
+}
|
||||
+
|
||||
+if (!Object.prototype.hasOwnProperty.call(globalThis, JEST_MATCHERS_OBJECT)) {
|
||||
+ const matchers = /* @__PURE__ */ Object.create(null);
|
||||
Object.defineProperty(globalThis, JEST_MATCHERS_OBJECT, {
|
||||
@ -30,8 +34,15 @@ index 5a61947ad50426d27390b4e82533179323ad3ba1..32bfc45909b645cb31cec2e204c8baa2
|
||||
matchers
|
||||
})
|
||||
});
|
||||
- Object.defineProperty(globalThis, ASYMMETRIC_MATCHERS_OBJECT, {
|
||||
- get: () => assymetricMatchers
|
||||
- });
|
||||
}
|
||||
+
|
||||
function getState(expect) {
|
||||
return globalThis[MATCHERS_OBJECT].get(expect);
|
||||
}
|
||||
+
|
||||
function setState(state, expect) {
|
||||
const map = globalThis[MATCHERS_OBJECT];
|
||||
const current = map.get(expect) || {};
|
@ -51,8 +51,8 @@
|
||||
"@testing-library/jest-dom": "^6.1.3",
|
||||
"@testing-library/user-event": "14.3.0",
|
||||
"@types/chai": "^4",
|
||||
"@vitest/expect": "^0.34.2",
|
||||
"@vitest/spy": "^0.34.1",
|
||||
"@vitest/expect": "patch:@vitest/expect@npm%3A1.1.3#~/.yarn/patches/@vitest-expect-npm-1.1.3-2062bf533f.patch",
|
||||
"@vitest/spy": "^1.1.3",
|
||||
"chai": "^4.3.7",
|
||||
"util": "^0.12.4"
|
||||
},
|
||||
|
@ -2,7 +2,7 @@ import {
|
||||
spyOn,
|
||||
isMockFunction,
|
||||
fn,
|
||||
spies as mocks,
|
||||
mocks,
|
||||
type MaybeMocked,
|
||||
type MaybeMockedDeep,
|
||||
type MaybePartiallyMocked,
|
||||
|
@ -80,7 +80,6 @@
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/experimental-utils": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
"@vitest/expect@^0.34.2": "patch:@vitest/expect@npm%3A0.34.5#./.yarn/patches/@vitest-expect-npm-0.34.5-8031508efe.patch",
|
||||
"esbuild": "^0.18.0",
|
||||
"eslint": "^8.28.0",
|
||||
"eslint-plugin-prettier": "^5.1.2",
|
||||
|
@ -6674,8 +6674,8 @@ __metadata:
|
||||
"@testing-library/jest-dom": "npm:^6.1.3"
|
||||
"@testing-library/user-event": "npm:14.3.0"
|
||||
"@types/chai": "npm:^4"
|
||||
"@vitest/expect": "npm:^0.34.2"
|
||||
"@vitest/spy": "npm:^0.34.1"
|
||||
"@vitest/expect": "patch:@vitest/expect@npm%3A1.1.3#~/.yarn/patches/@vitest-expect-npm-1.1.3-2062bf533f.patch"
|
||||
"@vitest/spy": "npm:^1.1.3"
|
||||
chai: "npm:^4.3.7"
|
||||
ts-dedent: "npm:^2.2.0"
|
||||
type-fest: "npm:~2.19"
|
||||
@ -8370,17 +8370,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vitest/expect@npm:0.34.5":
|
||||
version: 0.34.5
|
||||
resolution: "@vitest/expect@npm:0.34.5"
|
||||
dependencies:
|
||||
"@vitest/spy": "npm:0.34.5"
|
||||
"@vitest/utils": "npm:0.34.5"
|
||||
chai: "npm:^4.3.7"
|
||||
checksum: dc30a5e1f2732a1906df57f65381df1129dbf994496734c27e4a3f832852862501eaba1ec2987215ec12ee23a8f2ef1d8ff63c7cd5490046a7a26800da1adcb2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vitest/expect@npm:1.0.4":
|
||||
version: 1.0.4
|
||||
resolution: "@vitest/expect@npm:1.0.4"
|
||||
@ -8392,14 +8381,25 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vitest/expect@patch:@vitest/expect@npm%3A0.34.5#./.yarn/patches/@vitest-expect-npm-0.34.5-8031508efe.patch::locator=%40storybook%2Froot%40workspace%3A.":
|
||||
version: 0.34.5
|
||||
resolution: "@vitest/expect@patch:@vitest/expect@npm%3A0.34.5#./.yarn/patches/@vitest-expect-npm-0.34.5-8031508efe.patch::version=0.34.5&hash=f89b80&locator=%40storybook%2Froot%40workspace%3A."
|
||||
"@vitest/expect@npm:1.1.3":
|
||||
version: 1.1.3
|
||||
resolution: "@vitest/expect@npm:1.1.3"
|
||||
dependencies:
|
||||
"@vitest/spy": "npm:0.34.5"
|
||||
"@vitest/utils": "npm:0.34.5"
|
||||
chai: "npm:^4.3.7"
|
||||
checksum: b08f0b1df6a37305f3f68feec15cfac048ca9e3924998698625394296faac4e539e23d7422eec59c0850a83b7342b574a2d2d174aaa33a7eb0004e4e366c515c
|
||||
"@vitest/spy": "npm:1.1.3"
|
||||
"@vitest/utils": "npm:1.1.3"
|
||||
chai: "npm:^4.3.10"
|
||||
checksum: fe5c9eade516a754efc26d4b6378a250f0c3b668fa15b3e6b6042190b64a65c4459b7fd67bfca72fb1fbf215feb838b68da4ab224a2a10137d8828ca6af70516
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vitest/expect@patch:@vitest/expect@npm%3A1.1.3#~/.yarn/patches/@vitest-expect-npm-1.1.3-2062bf533f.patch":
|
||||
version: 1.1.3
|
||||
resolution: "@vitest/expect@patch:@vitest/expect@npm%3A1.1.3#~/.yarn/patches/@vitest-expect-npm-1.1.3-2062bf533f.patch::version=1.1.3&hash=5d51c9"
|
||||
dependencies:
|
||||
"@vitest/spy": "npm:1.1.3"
|
||||
"@vitest/utils": "npm:1.1.3"
|
||||
chai: "npm:^4.3.10"
|
||||
checksum: 426287f864f58b05b1c4689bc87b4ef2ca7b3316a22e8e42d94ee9c125cbc0caf294618c9a1201a8ddf8ab68ce1ab194d1e34589f7d608906a3dc679074cfe22
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -8425,15 +8425,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vitest/spy@npm:0.34.5":
|
||||
version: 0.34.5
|
||||
resolution: "@vitest/spy@npm:0.34.5"
|
||||
dependencies:
|
||||
tinyspy: "npm:^2.1.1"
|
||||
checksum: bbee495ca6300f50dde6418d14db0d3281daf38df15abae95202ddef253d6dd8bedf9f4a79da5a2246d3758ab24aa737caccf752fabcd8ba902a4f14801c2a0c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vitest/spy@npm:1.0.4":
|
||||
version: 1.0.4
|
||||
resolution: "@vitest/spy@npm:1.0.4"
|
||||
@ -8443,23 +8434,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vitest/spy@npm:^0.34.1":
|
||||
version: 0.34.7
|
||||
resolution: "@vitest/spy@npm:0.34.7"
|
||||
"@vitest/spy@npm:1.1.3, @vitest/spy@npm:^1.1.3":
|
||||
version: 1.1.3
|
||||
resolution: "@vitest/spy@npm:1.1.3"
|
||||
dependencies:
|
||||
tinyspy: "npm:^2.1.1"
|
||||
checksum: 1150b270eb72a5e8e7da997bcba90ebe5ed2ac50de1ea1f81738e16a19ab4bc77ca4d17639988df65695d4b325fe3647a1e4204d01024bcf5ecac8ba7764a2cc
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vitest/utils@npm:0.34.5":
|
||||
version: 0.34.5
|
||||
resolution: "@vitest/utils@npm:0.34.5"
|
||||
dependencies:
|
||||
diff-sequences: "npm:^29.4.3"
|
||||
loupe: "npm:^2.3.6"
|
||||
pretty-format: "npm:^29.5.0"
|
||||
checksum: 99cc5974ada1dab2b02220005c0fc97147baba175601a0faa1b2b6687c7f579d21a401077377d6f759b3aa8a07dcc8851cdc3e07f9a550ec289286107487ac36
|
||||
tinyspy: "npm:^2.2.0"
|
||||
checksum: d1692582afb7b665ec283723b15bbb7da95896cbfd7befaad9fdac6b64a8250fd918781263d43e8e10ee4874cdd18646224f6d993749c3751296dced8095a9ed
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -8474,6 +8454,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vitest/utils@npm:1.1.3":
|
||||
version: 1.1.3
|
||||
resolution: "@vitest/utils@npm:1.1.3"
|
||||
dependencies:
|
||||
diff-sequences: "npm:^29.6.3"
|
||||
estree-walker: "npm:^3.0.3"
|
||||
loupe: "npm:^2.3.7"
|
||||
pretty-format: "npm:^29.7.0"
|
||||
checksum: 86f48a7722927741449f40f33584dd9857629782f6661654225b5dd3c039d61cc60806c5dfe419bd793f2a231ba91fe708cbdec5d99b62a1f6f819b6f2121fc3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vitest/utils@npm:^0.34.6":
|
||||
version: 0.34.7
|
||||
resolution: "@vitest/utils@npm:0.34.7"
|
||||
@ -26996,7 +26988,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tinyspy@npm:^2.1.1, tinyspy@npm:^2.2.0":
|
||||
"tinyspy@npm:^2.2.0":
|
||||
version: 2.2.0
|
||||
resolution: "tinyspy@npm:2.2.0"
|
||||
checksum: 8c7b70748dd8590e85d52741db79243746c15bc03c92d75c23160a762142db577e7f53e360ba7300e321b12bca5c42dd2522a8dbeec6ba3830302573dd8516bc
|
||||
|
Loading…
x
Reference in New Issue
Block a user