Open History to see the last commit
1import { describe, expect, it, vi } from "vite-plus/test";
2
3const expoMocks = vi.hoisted(() => ({
4 requireNativeView: vi.fn(),
5}));
6
7vi.mock("expo", () => ({
8 requireNativeView: expoMocks.requireNativeView,
9}));
10
11describe("isPendingNativeViewRegistration", () => {
12 it("recognizes registration races for the installed native view name", async () => {
13 const { isPendingNativeViewRegistration } = await import("./nativeReviewDiffSurface");
14
15 expect(
16 isPendingNativeViewRegistration(
17 new Error("Unable to find the 'T3ReviewDiffSurface' view for this native tag"),
18 ),
19 ).toBe(true);
20 expect(
21 isPendingNativeViewRegistration(
22 new Error("Unable to find the 'T3ReviewDiffView' view for this native tag"),
23 ),
24 ).toBe(false);
25 expect(
26 isPendingNativeViewRegistration(
27 new Error(
28 "Unable to find the class expo.modules.t3reviewdiff.T3ReviewDiffView view with tag 1150",
29 ),
30 ),
31 ).toBe(true);
32 });
33});