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:
@@ -36,6 +36,21 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
|
extensions: [
|
||||||
|
".web.mjs",
|
||||||
|
".web.js",
|
||||||
|
".web.mts",
|
||||||
|
".web.ts",
|
||||||
|
".web.jsx",
|
||||||
|
".web.tsx",
|
||||||
|
".mjs",
|
||||||
|
".js",
|
||||||
|
".mts",
|
||||||
|
".ts",
|
||||||
|
".jsx",
|
||||||
|
".tsx",
|
||||||
|
".json",
|
||||||
|
],
|
||||||
alias: [
|
alias: [
|
||||||
{
|
{
|
||||||
find: /^@getpaseo\/relay\/e2ee$/,
|
find: /^@getpaseo\/relay\/e2ee$/,
|
||||||
|
|||||||
@@ -14,6 +14,21 @@ const resolvePackageEntry = (packageName: string) => {
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
resolve: {
|
resolve: {
|
||||||
|
extensions: [
|
||||||
|
".web.mjs",
|
||||||
|
".web.js",
|
||||||
|
".web.mts",
|
||||||
|
".web.ts",
|
||||||
|
".web.jsx",
|
||||||
|
".web.tsx",
|
||||||
|
".mjs",
|
||||||
|
".js",
|
||||||
|
".mts",
|
||||||
|
".ts",
|
||||||
|
".jsx",
|
||||||
|
".tsx",
|
||||||
|
".json",
|
||||||
|
],
|
||||||
alias: [
|
alias: [
|
||||||
{
|
{
|
||||||
find: /^@getpaseo\/relay\/e2ee$/,
|
find: /^@getpaseo\/relay\/e2ee$/,
|
||||||
|
|||||||
Reference in New Issue
Block a user