test(app): prebundle browser JSX runtime

This commit is contained in:
Mohamed Boudra
2026-08-18 01:03:42 +02:00
parent 3003ae25d5
commit 17f06443dc
2 changed files with 1 additions and 10 deletions
@@ -4,16 +4,6 @@ import { Pressable, Text } from "react-native";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { ComposerTrackPill, ComposerTrackRow } from "./tracks";
vi.mock("react-native-reanimated", async () => {
const actual =
await vi.importActual<typeof import("react-native-reanimated")>("react-native-reanimated");
const { View } = await vi.importActual<typeof import("react-native")>("react-native");
return {
...actual,
default: { ...actual.default, View },
};
});
// App sources compile against the classic JSX runtime, which expects React on the global.
beforeEach(() => vi.stubGlobal("React", React));
+1
View File
@@ -65,6 +65,7 @@ export default defineConfig({
// so it scans the native files and dies on imports react-native-web has no answer for.
// Unbundled, the same imports go through the resolver below and land on the web files.
optimizeDeps: {
include: ["react/jsx-runtime"],
exclude: ["react-native-reanimated"],
},
// The globals a React Native bundler defines, which esbuild is no longer there to supply for