mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
* feat: update sdk-internal * fix: symbol.dispose breaking change * fix: TextEncoder/Decoder breaking change * fix: move polyfills to a global setup script * typo
12 lines
473 B
TypeScript
12 lines
473 B
TypeScript
import { TextEncoder, TextDecoder } from "util";
|
|
|
|
// SDK/WASM code relies on TextEncoder/TextDecoder being available globally
|
|
// We can't use `test.environment.ts` because that breaks other tests that rely on
|
|
// the default jest jsdom environment
|
|
if (!(globalThis as any).TextEncoder) {
|
|
(globalThis as any).TextEncoder = TextEncoder;
|
|
}
|
|
if (!(globalThis as any).TextDecoder) {
|
|
(globalThis as any).TextDecoder = TextDecoder as unknown as typeof globalThis.TextDecoder;
|
|
}
|