Skip to content

Commit

Permalink
Add performance, readableStream to jsdom
Browse files Browse the repository at this point in the history
  • Loading branch information
dannon committed Aug 7, 2024
1 parent c204ff8 commit 6f9e516
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/tests/jest/jest.polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@

// https://mswjs.io/docs/migrations/1.x-to-2.x#frequent-issues

const { TextDecoder, TextEncoder } = require("node:util");
const { performance } = require("node:perf_hooks");
const { TextDecoder, TextEncoder, ReadableStream } = require("node:util");
const { clearImmediate } = require("node:timers");

Object.defineProperties(globalThis, {
TextDecoder: { value: TextDecoder },
TextEncoder: { value: TextEncoder },
performance: { value: performance },
ReadableStream: { value: ReadableStream },
clearImmediate: { value: clearImmediate },
});

Expand Down

0 comments on commit 6f9e516

Please sign in to comment.