From 543b51f7e80dbdb293dc2a3073f21057aa895845 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Thu, 3 Sep 2026 05:31:52 -0400 Subject: [PATCH] test(mobile): name the owned shell session type through the app module The type-aware CI lint resolves the file: shell package as an error type, which turned the ref's union into any and failed the changed-code gate. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- .../mobile-web/use-mobile-web-package-refresh.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mobile/src/mobile-web/use-mobile-web-package-refresh.test.ts b/mobile/src/mobile-web/use-mobile-web-package-refresh.test.ts index f20be305289..6a3531668f4 100644 --- a/mobile/src/mobile-web/use-mobile-web-package-refresh.test.ts +++ b/mobile/src/mobile-web/use-mobile-web-package-refresh.test.ts @@ -4,7 +4,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { MutableRefObject } from 'react' import type { RpcClient } from '../transport/rpc-client' import type { HostProfile } from '../transport/types' -import type { MobileWebShellSession } from '@orca/expo-mobile-web-shell' +import type { MobileWebPackageSession } from './mobile-web-package-session-state' const native = vi.hoisted(() => ({ openSession: vi.fn(), closeSession: vi.fn() })) const downloadPackage = vi.hoisted(() => vi.fn()) @@ -18,6 +18,10 @@ vi.mock('./mobile-web-package-downloader', () => ({ import { useMobileWebPackageRefresh } from './use-mobile-web-package-refresh' +// Why: the type-aware CI lint resolves the file: shell package as `error`, so name the +// session type through the app module instead of the package. +type OwnedSession = NonNullable + const HOST: HostProfile = { id: 'host-1', name: 'Desktop', @@ -27,7 +31,7 @@ const HOST: HostProfile = { lastConnected: 1 } const BUILD_ID = 'a'.repeat(64) -const OWNED: MobileWebShellSession = { +const OWNED: OwnedSession = { sessionId: 'session-a', buildId: BUILD_ID, url: 'https://session-a.orca-mobile-web.invalid/#session-a' @@ -63,7 +67,7 @@ describe('useMobileWebPackageRefresh', () => { : { commit: { buildId: BUILD_ID }, reusedVerifiedBuild: false } }) - const ownedSessionRef = ref(OWNED) + const ownedSessionRef = ref(OWNED) function Harness(): null { useMobileWebPackageRefresh({ client: { sendRequest: vi.fn() } as unknown as RpcClient,