Testing
An app built with SymbioteNative is tested the same way as any other React Native app — SymbioteNative doesn’t ask for a different tool. Two layers: headless component/integration tests, and real-device end-to-end journeys.
Headless tests — Vitest and Node
Section titled “Headless tests — Vitest and Node”Component and integration tests run against a fake Fabric slot — no simulator, device, or native build. Production-critical ESM/CommonJS tools use Node’s built-in test runner so they exercise the exact module format shipped and run without a Vite transform:
pnpm test # both layerspnpm test:vitest # TypeScript component/integration suitespnpm test:node # native .test.mjs/.test.cjs tooling suitesVitest tests live next to what they exercise (Component.test.ts(x) beside
Component.ts(x)) across core/, adapters/, and packages/. The Node
runner discovers every *.test.mjs and *.test.cjs under scripts/ and
packages/, excluding generated build and dependency trees. Adding such a
suite therefore places it under the same root pnpm test command CI runs.
End-to-end journeys — Detox
Section titled “End-to-end journeys — Detox”Real-device (or simulator) tests drive an actual build of the app:
pnpm -C examples/react e2e:build:ios && pnpm -C examples/react e2e:test:iospnpm -C examples/react e2e:build:android && pnpm -C examples/react e2e:test:androidThe e2e:* scripts live in each example’s own package.json
(examples/react, examples/vue-sfc, examples/vue-tsx, examples/angular,
examples/svelte), not the repo root.
A gotcha specific to perpetual animations
Section titled “A gotcha specific to perpetual animations”Detox’s default synchronization waits for the app to go idle before running
the next step — but an app with a perpetual native Animated.loop (a
heartbeat pulse, a spinner) never reports idle, so device.launchApp()
hangs. Disable synchronization for that launch:
await device.launchApp({ newInstance: true, launchArgs: { detoxEnableSynchronization: 0 },});You then drive individual assertions with explicit waitFor(...) calls
instead of relying on Detox’s automatic idle detection.