MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / make

Function make

packages/react/src/org-slug-routing.test.ts:19–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17};
18
19const make = (): SpikeRouter => {
20 const rootRoute = createRootRoute();
21 const orgScope = createRoute({
22 getParentRoute: () => rootRoute,
23 path: "/{-$orgSlug}",
24 });
25 const indexRoute = createRoute({ getParentRoute: () => orgScope, path: "/" });
26 const policiesRoute = createRoute({ getParentRoute: () => orgScope, path: "/policies" });
27 const nsRoute = createRoute({
28 getParentRoute: () => orgScope,
29 path: "/integrations/$namespace",
30 });
31 const loginRoute = createRoute({ getParentRoute: () => rootRoute, path: "/login" });
32 const routeTree = rootRoute.addChildren([
33 orgScope.addChildren([indexRoute, policiesRoute, nsRoute]),
34 loginRoute,
35 ]);
36 // This local tree is NOT the package's registered console tree, so widen
37 // away the global Register types — the test asserts runtime semantics.
38 // oxlint-disable-next-line executor/no-double-cast -- boundary: a test-local route tree must escape the package-global router Register types
39 return createRouter({
40 routeTree,
41 history: createMemoryHistory({ initialEntries: ["/"] }),
42 }) as unknown as SpikeRouter;
43};
44
45describe("optional org-slug segment", () => {
46 it("matches bare and slugged URLs with the same route", async () => {

Callers 2

defaultForSchemaFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected