Skip to content

Commit 81c07ef

Browse files
committed
fixs test
1 parent f93dfec commit 81c07ef

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
"openapi-typescript-codegen": "^0.27.0",
127127
"prettier": "^3.2.5",
128128
"react-test-renderer": "18.2.0",
129+
"text-encoding": "^0.7.0",
129130
"ts-jest": "^29.1.2",
130131
"typescript": "^5.1.3"
131132
},

test/setup.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import "@testing-library/jest-native";
44

55
import "@testing-library/jest-native/extend-expect";
66

7+
import { TextEncoder, TextDecoder } from "util";
8+
9+
(global as any).TextEncoder = TextEncoder;
10+
(global as any).TextDecoder = TextDecoder;
11+
712
jest.mock("react-native/Libraries/Animated/NativeAnimatedHelper");
813

914
// Mock AsyncStorage

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14445,6 +14445,11 @@ text-encoding-polyfill@^0.6.7:
1444514445
resolved "https://registry.yarnpkg.com/text-encoding-polyfill/-/text-encoding-polyfill-0.6.7.tgz#4d27de0153e4c86eb2631ffd74c2f3f57969a9ec"
1444614446
integrity sha512-/DZ1XJqhbqRkCop6s9ZFu8JrFRwmVuHg4quIRm+ziFkR3N3ec6ck6yBvJ1GYeEQZhLVwRW0rZE+C3SSJpy0RTg==
1444714447

14448+
text-encoding@^0.7.0:
14449+
version "0.7.0"
14450+
resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.7.0.tgz#f895e836e45990624086601798ea98e8f36ee643"
14451+
integrity sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA==
14452+
1444814453
text-table@^0.2.0:
1444914454
version "0.2.0"
1445014455
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"

0 commit comments

Comments
 (0)