File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,18 @@ import '@testing-library/jest-dom';
22
33import { TextDecoder , TextEncoder } from 'node:util' ;
44
5- if ( ! global . TextEncoder || ! global . TextDecoder ) {
6- /**
7- * Prevent the following errors with jest:
8- * - ReferenceError: TextEncoder is not defined
9- * - ReferenceError: TextDecoder is not defined
10- */
11- global . TextEncoder = TextEncoder ;
12- global . TextDecoder = TextDecoder ;
5+ /**
6+ * Prevent the following errors with jest:
7+ * - ReferenceError: TextEncoder is not defined
8+ * - ReferenceError: TextDecoder is not defined
9+ */
10+ if ( ! ( 'TextEncoder' in globalThis ) ) {
11+ ( globalThis as unknown as { TextEncoder : typeof TextEncoder } ) . TextEncoder =
12+ TextEncoder ;
13+ }
14+ if ( ! ( 'TextDecoder' in globalThis ) ) {
15+ ( globalThis as unknown as { TextDecoder : typeof TextDecoder } ) . TextDecoder =
16+ TextDecoder ;
1317}
1418
1519// Mock OAuth client ID and secret
You can’t perform that action at this time.
0 commit comments