Skip to content

Commit 845bd24

Browse files
authored
chore(🧪): fix returned architecture in the e2e testing (#3270)
1 parent b5cd478 commit 845bd24

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

‎apps/example/src/Tests/useClient.ts‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { useEffect, useState } from "react";
22
import { Platform } from "react-native";
33

4-
// eslint-disable-next-line @typescript-eslint/no-namespace
5-
declare namespace global {
6-
var _IS_FABRIC: boolean;
7-
}
8-
4+
const { OS } = Platform;
95
const ANDROID_WS_HOST = "10.0.2.2";
106
const IOS_WS_HOST = "localhost";
11-
const HOST = Platform.OS === "android" ? ANDROID_WS_HOST : IOS_WS_HOST;
7+
const HOST = OS === "android" ? ANDROID_WS_HOST : IOS_WS_HOST;
128
const PORT = 4242;
9+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10+
const arch = (global as any)?.nativeFabricUIManager ? "fabric" : "paper";
1311

1412
type UseClient = [client: WebSocket | null, hostname: string];
1513
export const useClient = (): UseClient => {
@@ -24,8 +22,8 @@ export const useClient = (): UseClient => {
2422
setClient(ws);
2523
ws.send(
2624
JSON.stringify({
27-
OS: Platform.OS,
28-
arch: "paper",
25+
OS,
26+
arch,
2927
})
3028
);
3129
};

0 commit comments

Comments
 (0)