From d9d6509880de76ad777c5b2b873ef0b3fcc3f20a Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sun, 19 Apr 2026 15:11:37 +0700 Subject: [PATCH] fix(test): resolve Metro .web.ts variants in vitest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit message-input.tsx imports ./composer-height-mirror, which only exists as .web.ts / .native.ts / .d.ts. Metro picks the right variant at build time, but vitest was using Vite's default extension list and failing to resolve the import — breaking app tests in CI. Prepend `.web.*` variants to `resolve.extensions` in both the root and app vitest configs so test runs (which already alias react-native → react-native-web) pick the web implementation, matching what Metro does for the web bundle. --- packages/app/vitest.config.ts | 15 +++++++++++++++ vitest.config.ts | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/packages/app/vitest.config.ts b/packages/app/vitest.config.ts index a1986df8c..6b55aceff 100644 --- a/packages/app/vitest.config.ts +++ b/packages/app/vitest.config.ts @@ -36,6 +36,21 @@ export default defineConfig({ }, }, resolve: { + extensions: [ + ".web.mjs", + ".web.js", + ".web.mts", + ".web.ts", + ".web.jsx", + ".web.tsx", + ".mjs", + ".js", + ".mts", + ".ts", + ".jsx", + ".tsx", + ".json", + ], alias: [ { find: /^@getpaseo\/relay\/e2ee$/, diff --git a/vitest.config.ts b/vitest.config.ts index 1cc00f79c..2f1f4684a 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -14,6 +14,21 @@ const resolvePackageEntry = (packageName: string) => { export default defineConfig({ resolve: { + extensions: [ + ".web.mjs", + ".web.js", + ".web.mts", + ".web.ts", + ".web.jsx", + ".web.tsx", + ".mjs", + ".js", + ".mts", + ".ts", + ".jsx", + ".tsx", + ".json", + ], alias: [ { find: /^@getpaseo\/relay\/e2ee$/,