Skip to content

Commit 1931606

Browse files
thinkasanyCopilot
andauthored
chore: bump jsdom@28 (ant-design#56835)
* chore: bump jsdom@28 * Update tests/setup.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: thinkasany <480968828@qq.com> --------- Signed-off-by: thinkasany <480968828@qq.com> Signed-off-by: meet-student <1875694521@qq.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ceddbda commit 1931606

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
"jest-image-snapshot": "^6.5.1",
269269
"jest-puppeteer": "^11.0.0",
270270
"jquery": "^4.0.0",
271-
"jsdom": "^27.4.0",
271+
"jsdom": "^28.0.0",
272272
"jsonml-to-react-element": "^1.1.11",
273273
"jsonml.js": "^0.1.0",
274274
"lint-staged": "^16.2.7",

tests/setup.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
import util from 'util';
22
import React from 'react';
33
import type { DOMWindow } from 'jsdom';
4+
import { MessagePort } from 'node:worker_threads';
5+
import { ReadableStream } from 'node:stream/web';
6+
7+
if (typeof globalThis.ReadableStream === 'undefined') {
8+
Object.defineProperty(
9+
globalThis as typeof globalThis & { ReadableStream: typeof ReadableStream },
10+
'ReadableStream',
11+
{
12+
value: ReadableStream,
13+
writable: true,
14+
configurable: true,
15+
},
16+
);
17+
}
418

19+
if (typeof globalThis.MessagePort === 'undefined') {
20+
Object.defineProperty(
21+
globalThis as typeof globalThis & { MessagePort: typeof MessagePort },
22+
'MessagePort',
23+
{
24+
value: MessagePort,
25+
writable: true,
26+
configurable: true,
27+
},
28+
);
29+
}
530
console.log('Current React Version:', React.version);
631

732
const originConsoleErr = console.error;

0 commit comments

Comments
 (0)