diff --git a/tests/test-weird-deps/routes.d.ts b/tests/test-weird-deps/routes.d.ts index b09b6fbe4..32d29d669 100644 --- a/tests/test-weird-deps/routes.d.ts +++ b/tests/test-weird-deps/routes.d.ts @@ -1,3 +1,8 @@ +// deno-lint-ignore-file +/* eslint-disable */ +// biome-ignore: needed import +import type { OneRouter } from 'one' + declare module 'one' { export namespace OneRouter { export interface __routes extends Record { @@ -7,4 +12,4 @@ declare module 'one' { IsTyped: true } } -} +} \ No newline at end of file diff --git a/tests/test-weird-deps/src/bad-deps.ts b/tests/test-weird-deps/src/bad-deps.ts index b9340e48a..88fb9cb36 100644 --- a/tests/test-weird-deps/src/bad-deps.ts +++ b/tests/test-weird-deps/src/bad-deps.ts @@ -3,8 +3,10 @@ import * as Sentry from '@sentry/react-native' import { FlashList } from '@shopify/flash-list' import { Path } from 'react-native-svg' import WebView from 'react-native-webview' +import { Image } from 'expo-image' ensureExists('react-native-svg', Path) +ensureExists('expo-image', Image) ensureExists('@react-native-masked-view/masked-view', MaskedView) ensureExists('react-native-webview', WebView) ensureExists('@sentry/react-native', Sentry) diff --git a/tests/test/app/deps/expo-image.tsx b/tests/test/app/deps/expo-image.tsx new file mode 100644 index 000000000..e3a4aa699 --- /dev/null +++ b/tests/test/app/deps/expo-image.tsx @@ -0,0 +1,8 @@ +import { Image } from 'expo-image' + +export default () => ( + +) diff --git a/tests/test/package.json b/tests/test/package.json index a300726b2..4c3a5b12d 100644 --- a/tests/test/package.json +++ b/tests/test/package.json @@ -24,6 +24,7 @@ "@tamagui/vite-plugin": "^1.123.1", "@vxrn/color-scheme": "workspace:*", "expo": "~52.0.17", + "expo-image": "~1.13.0", "expo-video": "^2.0.4", "one": "workspace:*", "postgres": "^3.4.4", diff --git a/tests/test/routes.d.ts b/tests/test/routes.d.ts index 3df02c3df..588d026a6 100644 --- a/tests/test/routes.d.ts +++ b/tests/test/routes.d.ts @@ -6,7 +6,7 @@ import type { OneRouter } from 'one' declare module 'one' { export namespace OneRouter { export interface __routes extends Record { - StaticRoutes: `/` | `/(auth-guard)` | `/(auth-guard)/auth-guard` | `/(blog)` | `/(blog)/blog/my-first-post` | `/(marketing)/about` | `/(sub-page-group)` | `/(sub-page-group)/sub-page` | `/(sub-page-group)/sub-page/sub` | `/(sub-page-group)/sub-page/sub2` | `/_sitemap` | `/about` | `/auth-guard` | `/blog/my-first-post` | `/expo-video` | `/hooks` | `/hooks/contents` | `/hooks/contents/page-1` | `/hooks/contents/page-2` | `/loader` | `/loader/other` | `/middleware` | `/not-found/deep/test` | `/not-found/fallback/test` | `/not-found/test` | `/server-data` | `/sheet` | `/spa/spapage` | `/ssr/basic` | `/sub-page` | `/sub-page/sub` | `/sub-page/sub2` + StaticRoutes: `/` | `/(auth-guard)` | `/(auth-guard)/auth-guard` | `/(blog)` | `/(blog)/blog/my-first-post` | `/(marketing)/about` | `/(sub-page-group)` | `/(sub-page-group)/sub-page` | `/(sub-page-group)/sub-page/sub` | `/(sub-page-group)/sub-page/sub2` | `/_sitemap` | `/about` | `/auth-guard` | `/blog/my-first-post` | `/expo-image` | `/expo-video` | `/hooks` | `/hooks/contents` | `/hooks/contents/page-1` | `/hooks/contents/page-2` | `/loader` | `/loader/other` | `/middleware` | `/not-found/deep/test` | `/not-found/fallback/test` | `/not-found/test` | `/server-data` | `/sheet` | `/spa/spapage` | `/ssr/basic` | `/sub-page` | `/sub-page/sub` | `/sub-page/sub2` DynamicRoutes: `/not-found/+not-found` | `/not-found/deep/+not-found` | `/routes/subpath/${string}` | `/spa/${OneRouter.SingleRoutePart}` | `/ssr/${OneRouter.SingleRoutePart}` | `/ssr/${string}` DynamicRouteTemplate: `/not-found/+not-found` | `/not-found/deep/+not-found` | `/routes/subpath/[...subpath]` | `/spa/[spaparams]` | `/ssr/[...rest]` | `/ssr/[param]` IsTyped: true diff --git a/tests/test/tests/deps.test.ts b/tests/test/tests/deps.test.ts new file mode 100644 index 000000000..cc2681783 --- /dev/null +++ b/tests/test/tests/deps.test.ts @@ -0,0 +1,39 @@ +import { type Browser, type BrowserContext, chromium } from 'playwright' +import { afterAll, beforeAll, describe, expect, test } from 'vitest' + +const serverUrl = process.env.ONE_SERVER_URL +const isDebug = !!process.env.DEBUG + +let browser: Browser +let context: BrowserContext + +beforeAll(async () => { + browser = await chromium.launch({ headless: !isDebug }) + context = await browser.newContext() +}) + +afterAll(async () => { + await browser.close() +}) + +describe('Deps (web)', () => { + test('expo-image', async () => { + const page = await context.newPage() + + const consoleErrors: string[] = [] + page.on('console', (msg) => { + if (msg.type() === 'error') { + consoleErrors.push(msg.text()) + } + }) + + await page.goto(serverUrl + '/deps/expo-image') + + const img = await page.$('img[src=https://tamagui.dev/social.png]') + + expect(img).not.toBeNull() + expect(consoleErrors).toHaveLength(0) + + await page.close() + }) +}) diff --git a/yarn.lock b/yarn.lock index bd88ee4e1..9c2449366 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28244,6 +28244,7 @@ __metadata: "@vxrn/color-scheme": "workspace:*" "@vxrn/utils": "workspace:*" expo: "npm:~52.0.17" + expo-image: "npm:~1.13.0" expo-video: "npm:^2.0.4" get-port-please: "npm:^3.1.2" one: "workspace:*"