fix(test): resolve Metro .web.ts variants in vitest

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.
This commit is contained in:
Mohamed Boudra
2026-04-19 15:11:37 +07:00
parent 2d9cbb0453
commit d9d6509880
2 changed files with 30 additions and 0 deletions

View File

@@ -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$/,

View File

@@ -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$/,