Skip to content

Commit 16be129

Browse files
authored
Update jest.setup.ts
1 parent 4b42518 commit 16be129

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/renderer/__helpers__/jest.setup.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { TextDecoder, TextEncoder } from 'node:util';
22

33
// Prevent "ReferenceError: TextEncoder is not defined" or "ReferenceError: TextDecoder is not defined" errors
4-
global.TextEncoder = TextEncoder;
5-
global.TextDecoder = TextDecoder;
4+
if (!global.TextEncoder || !global.TextDecoder) {
5+
global.TextEncoder = TextEncoder;
6+
global.TextDecoder = TextDecoder;
7+
}
68

79
// Mock OAuth client ID and secret
810
process.env.OAUTH_CLIENT_ID = 'FAKE_CLIENT_ID_123';

0 commit comments

Comments
 (0)