We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b42518 commit 16be129Copy full SHA for 16be129
src/renderer/__helpers__/jest.setup.ts
@@ -1,8 +1,10 @@
1
import { TextDecoder, TextEncoder } from 'node:util';
2
3
// Prevent "ReferenceError: TextEncoder is not defined" or "ReferenceError: TextDecoder is not defined" errors
4
-global.TextEncoder = TextEncoder;
5
-global.TextDecoder = TextDecoder;
+if (!global.TextEncoder || !global.TextDecoder) {
+ global.TextEncoder = TextEncoder;
6
+ global.TextDecoder = TextDecoder;
7
+}
8
9
// Mock OAuth client ID and secret
10
process.env.OAUTH_CLIENT_ID = 'FAKE_CLIENT_ID_123';
0 commit comments