import assert from "node:assert/strict";
import test from "node:test";
import { tsImport } from "tsx/esm/api";
const { discoverReactNavigation } = await tsImport("../../src/source/route-providers/react-navigation.ts", import.meta.url);
const { validateSourceRoute } = await tsImport("../../src/contracts/source-route.ts", import.meta.url);
const { createSourceCapturePlan, canonicalPlan } = await tsImport("../../src/source/capture-plan.ts", import.meta.url);
const named = (result, name) => result.routes.filter(route => route.route === name);
const edgeNames = result => result.edges.map(edge => [
result.routes.find(route => route.id === edge.from).route,
result.routes.find(route => route.id === edge.to).route,
edge.kind,
]);
test("JSX registration is the inventory, including screens absent from linking", () => {
const result = discoverReactNavigation({
"src/App.tsx": `import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator as createStack } from '@react-navigation/native-stack';
import { NAMES } from './names'; import { Home, Detail } from './screens'; import linking from './linking';
const Stack = createStack();
export default function App() { return
; }`,
"src/names.ts": `export const NAMES = { home: 'Home', detail: 'Detail' } as const;`,
"src/screens.ts": `export { Home } from './Home'; export { default as Detail } from './Detail';`,
"src/Home.tsx": `import {NAMES} from './names'; export function Home({navigation}) { return