1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 13:23:34 +00:00

Update sdk-internal to 374 (fix breaking changes) (#17325)

* feat: update sdk-internal

* fix: symbol.dispose breaking change

* fix: TextEncoder/Decoder breaking change

* fix: move polyfills to a global setup script

* typo
This commit is contained in:
Andreas Coroiu
2025-11-11 15:01:03 +01:00
committed by GitHub
parent 97ce47b832
commit a66227638e
7 changed files with 27 additions and 11 deletions

View File

@@ -9,6 +9,8 @@ module.exports = {
// Also anecdotally improves performance when run locally
maxWorkers: 3,
setupFiles: ["<rootDir>/../../libs/shared/polyfill-node-globals.ts"],
transform: {
"^.+\\.tsx?$": [
"ts-jest",

View File

@@ -0,0 +1,11 @@
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;
}