test(app): reproduce native terminal startup before navigator initialization

This commit is contained in:
paseo-bot[bot]
2026-10-10 13:59:46 +02:00
parent e81d5d02b1
commit 78a9554ddb
@@ -0,0 +1,11 @@
import { readFileSync } from "node:fs";
import { createRequire } from "node:module";
import { runInNewContext } from "node:vm";
import { expect, it } from "vitest";
it("loads the native terminal dependency with the initial React Native navigator", () => {
const require = createRequire(import.meta.url);
const source = readFileSync(require.resolve("@xterm/headless"), "utf8");
// React Native exposes navigator before the app's layout initializes its polyfill.
expect(() => runInNewContext(source, { navigator: {}, module: { exports: {} } })).not.toThrow();
});