repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-architect/__tests__/server-test.ts
packages/react-router-architect/__tests__/server-test.ts
import fsp from "node:fs/promises"; import path from "node:path"; import { createRequestHandler as createReactRequestHandler } from "react-router"; import type { APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2, } from "aws-lambda"; import lambdaTester from "lambda-tester"; import { createRequestHandler...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-architect/__tests__/binaryTypes-test.ts
packages/react-router-architect/__tests__/binaryTypes-test.ts
import { isBinaryType } from "../binaryTypes"; describe("architect isBinaryType", () => { it("should detect binary contentType correctly", () => { expect(isBinaryType(undefined)).toBe(false); expect(isBinaryType(null)).toBe(false); expect(isBinaryType("text/html; charset=utf-8")).toBe(false); expect(...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-architect/sessions/arcTableSessionStorage.ts
packages/react-router-architect/sessions/arcTableSessionStorage.ts
import type { SessionData, SessionStorage, SessionIdStorageStrategy, } from "react-router"; import { createSessionStorage } from "react-router"; import arc from "@architect/functions"; import type { ArcTable } from "@architect/functions/types/tables"; interface ArcTableSessionStorageOptions { /** * The Cook...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/dom-export.ts
packages/react-router/dom-export.ts
/** * @module dom */ "use client"; export type { RouterProviderProps } from "./lib/dom-export/dom-router-provider"; export { RouterProvider } from "./lib/dom-export/dom-router-provider"; export type { HydratedRouterProps } from "./lib/dom-export/hydrated-router"; export { HydratedRouter } from "./lib/dom-export/hyd...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/index-react-server.ts
packages/react-router/index-react-server.ts
// RSC APIs export { matchRSCServerRequest as unstable_matchRSCServerRequest } from "./lib/rsc/server.rsc"; export type { DecodeActionFunction as unstable_DecodeActionFunction, DecodeFormStateFunction as unstable_DecodeFormStateFunction, DecodeReplyFunction as unstable_DecodeReplyFunction, LoadServerActionFunc...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/tsup.config.rsc.ts
packages/react-router/tsup.config.rsc.ts
import { defineConfig, type Options } from "tsup"; // @ts-ignore - out of scope import { createBanner } from "../../build.utils.js"; import pkg from "./package.json"; const entry = ["index-react-server.ts"]; const external = ["react-router", "react-router/internal/react-server-client"]; const config = (enableDevWar...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/index-react-server-client.ts
packages/react-router/index-react-server-client.ts
"use client"; export { AwaitContextProvider as UNSAFE_AwaitContextProvider } from "./lib/context"; export { MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, WithComponentProps as UNSAFE_WithComponentProps, WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps, WithHydrateFal...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/tsup.config.ts
packages/react-router/tsup.config.ts
import { defineConfig } from "tsup"; // @ts-ignore - out of scope import { createBanner } from "../../build.utils.js"; import pkg from "./package.json"; const entry = [ "index.ts", "index-react-server-client.ts", "dom-export.ts", "lib/types/internal.ts", ]; const config = (enableDevWarnings: boolean) => d...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/index.ts
packages/react-router/index.ts
/** * @module index * @mergeModuleWith react-router */ "use client"; // Expose old @remix-run/router API export type { InitialEntry, Location, Path, To } from "./lib/router/history"; export type { HydrationState, StaticHandler, GetScrollPositionFunction, GetScrollRestorationKeyFunction, StaticHandlerCont...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/vendor/turbo-stream-v2/utils.ts
packages/react-router/vendor/turbo-stream-v2/utils.ts
export const HOLE = -1; export const NAN = -2; export const NEGATIVE_INFINITY = -3; export const NEGATIVE_ZERO = -4; export const NULL = -5; export const POSITIVE_INFINITY = -6; export const UNDEFINED = -7; export const TYPE_BIGINT = "B"; export const TYPE_DATE = "D"; export const TYPE_ERROR = "E"; export const TYPE_M...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/vendor/turbo-stream-v2/flatten.ts
packages/react-router/vendor/turbo-stream-v2/flatten.ts
import { HOLE, NAN, NEGATIVE_INFINITY, NEGATIVE_ZERO, NULL, POSITIVE_INFINITY, UNDEFINED, TYPE_BIGINT, TYPE_DATE, TYPE_ERROR, TYPE_MAP, TYPE_NULL_OBJECT, TYPE_PROMISE, TYPE_REGEXP, TYPE_SET, TYPE_SYMBOL, TYPE_URL, type ThisEncode, } from "./utils"; export function flatten(this: This...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/vendor/turbo-stream-v2/unflatten.ts
packages/react-router/vendor/turbo-stream-v2/unflatten.ts
import { Deferred, HOLE, NAN, NEGATIVE_INFINITY, NEGATIVE_ZERO, NULL, POSITIVE_INFINITY, UNDEFINED, TYPE_BIGINT, TYPE_DATE, TYPE_ERROR, TYPE_MAP, TYPE_NULL_OBJECT, TYPE_PREVIOUS_RESOLVED, TYPE_PROMISE, TYPE_REGEXP, TYPE_SET, TYPE_SYMBOL, TYPE_URL, type ThisDecode, } from "./utils...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/vendor/turbo-stream-v2/turbo-stream.ts
packages/react-router/vendor/turbo-stream-v2/turbo-stream.ts
import { flatten } from "./flatten"; import { unflatten } from "./unflatten"; import { Deferred, TYPE_ERROR, TYPE_PREVIOUS_RESOLVED, TYPE_PROMISE, createLineSplittingTransform, type DecodePlugin, type EncodePlugin, type ThisDecode, type ThisEncode, } from "./utils"; export type { DecodePlugin, Encode...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/matchRoutes-test.tsx
packages/react-router/__tests__/matchRoutes-test.tsx
import * as React from "react"; import type { RouteObject } from "react-router"; import { matchRoutes } from "react-router"; function pickPaths( routes: RouteObject[], pathname: string, basename?: string, ): string[] | null { let matches = matchRoutes(routes, pathname, basename); return matches && matches.ma...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/descendant-routes-splat-matching-test.tsx
packages/react-router/__tests__/descendant-routes-splat-matching-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Outlet, Routes, Route, useParams } from "react-router"; import type { InitialEntry } from "react-router"; describe("Descendant <Routes> splat matching", () => { describe("when the parent route path ends with /...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/path-matching-test.tsx
packages/react-router/__tests__/path-matching-test.tsx
import type { RouteObject } from "react-router"; import { matchPath, matchRoutes } from "react-router"; function pickPaths(routes: RouteObject[], pathname: string): string[] | null { let matches = matchRoutes(routes, pathname); return matches && matches.map((match) => match.route.path || ""); } function pickPaths...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/useParams-test.tsx
packages/react-router/__tests__/useParams-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Outlet, Routes, Route, useParams } from "react-router"; function ShowParams() { return <pre>{JSON.stringify(useParams())}</pre>; } describe("useParams", () => { describe("when the route isn't matched", () =...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/Routes-location-test.tsx
packages/react-router/__tests__/Routes-location-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Route, Routes, useParams } from "react-router"; describe("<Routes> with a location", () => { function Home() { return <h1>Home</h1>; } function User() { let { userId } = useParams(); return ( ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/navigate-test.tsx
packages/react-router/__tests__/navigate-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Navigate, Outlet, Routes, Route, RouterProvider, createMemoryRouter, useLocation, } from "react-router"; import { render, screen, waitFor } from "@testing-library/react"; import getHtml from "../...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/useLocation-test.tsx
packages/react-router/__tests__/useLocation-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route, useLocation } from "react-router"; function ShowLocation() { let location = useLocation(); return <pre>{JSON.stringify(location)}</pre>; } describe("useLocation", () => { it("returns the cu...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/data-router-no-dom-test.tsx
packages/react-router/__tests__/data-router-no-dom-test.tsx
/** * @jest-environment node */ import * as React from "react"; import renderer from "react-test-renderer"; import { useFetcher } from "../lib/dom/lib"; import { RouterProvider } from "../lib/dom-export/dom-router-provider"; import { createMemoryRouter } from "../lib/components"; import { useLoaderData, useNavigate ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/route-depth-order-matching-test.tsx
packages/react-router/__tests__/route-depth-order-matching-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Outlet, Routes, Route } from "react-router"; describe("nested routes with no path", () => { it("matches them depth-first", () => { let renderer: TestRenderer.ReactTestRenderer; TestRenderer.act(() => {...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/gh-issue-8127-test.tsx
packages/react-router/__tests__/gh-issue-8127-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route } from "../index"; describe("GH Issue #8127", () => { it("works", () => { let renderer: TestRenderer.ReactTestRenderer; TestRenderer.act(() => { renderer = TestRenderer.create( ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/resolvePath-test.tsx
packages/react-router/__tests__/resolvePath-test.tsx
import { resolvePath } from "react-router"; describe("resolvePath", () => { it("does not touch with protocol-less absolute paths", () => { expect(resolvePath("//google.com")).toMatchObject({ pathname: "//google.com", }); expect(resolvePath("//google.com/../../path")).toMatchObject({ pathname...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/matchPath-test.tsx
packages/react-router/__tests__/matchPath-test.tsx
import { matchPath } from "react-router"; describe("matchPath", () => { it("matches the root / URL", () => { expect(matchPath("/", "/")).toMatchObject({ pathname: "/", pathnameBase: "/", }); }); describe("when the pattern has no leading slash", () => { it("fails to match a pathname that ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/Router-basename-test.tsx
packages/react-router/__tests__/Router-basename-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route } from "react-router"; describe("<Router basename>", () => { let consoleWarn: jest.SpyInstance; beforeEach(() => { consoleWarn = jest.spyOn(console, "warn").mockImplementation(() => {}); ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/same-component-lifecycle-test.tsx
packages/react-router/__tests__/same-component-lifecycle-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route } from "react-router"; describe("when the same component is mounted by two different routes", () => { it("mounts only once", () => { let mountCount = 0; class Home extends React.Componen...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/useResolvedPath-test.tsx
packages/react-router/__tests__/useResolvedPath-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import type { Path } from "react-router"; import { MemoryRouter, Routes, Route, useResolvedPath, useLocation, } from "react-router"; import { prettyDOM, render } from "@testing-library/react"; function ShowResolvedPath({ pat...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/gh-issue-8165-test.tsx
packages/react-router/__tests__/gh-issue-8165-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route, useParams, useNavigate, Navigate, } from "../index"; describe("GH Issue #8165", () => { it("works", () => { const Content = () => { return ( <div> <h3>Lev...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/index-routes-test.tsx
packages/react-router/__tests__/index-routes-test.tsx
import { matchRoutes } from "react-router"; describe("index route matching", () => { it("throws when the index route has children", () => { expect(() => { matchRoutes( [ { path: "/users", children: [ // This config is not valid because index routes ca...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/greedy-matching-test.tsx
packages/react-router/__tests__/greedy-matching-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route, Outlet } from "../index"; describe("greedy matching", () => { let routes = ( <Routes> <Route path="/" element={<p>Root</p>} /> <Route path="home" element={ ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/href-test.ts
packages/react-router/__tests__/href-test.ts
import { href } from "../lib/href"; describe("href", () => { it("works with param-less paths", () => { expect(href("/a/b/c")).toBe("/a/b/c"); }); it("works with params", () => { expect(href("/a/:b", { b: "hello", z: "ignored" })).toBe("/a/hello"); expect(href("/a/:b?", { b: "hello", z: "ignored" }))...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/descendant-routes-params-test.tsx
packages/react-router/__tests__/descendant-routes-params-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route, useParams } from "react-router"; describe("Descendant <Routes>", () => { it("receive all params from ancestor <Routes>", () => { function ShowParams() { return <p>The params are {JSON....
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/Routes-test.tsx
packages/react-router/__tests__/Routes-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route } from "react-router"; describe("<Routes>", () => { let consoleWarn: jest.SpyInstance; let consoleError: jest.SpyInstance; beforeEach(() => { consoleWarn = jest.spyOn(console, "warn").moc...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/setup.ts
packages/react-router/__tests__/setup.ts
// https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#configuring-your-testing-environment globalThis.IS_REACT_ACT_ENVIRONMENT = true; if (!globalThis.TextEncoder || !globalThis.TextDecoder) { const { TextDecoder, TextEncoder } = require("node:util"); globalThis.TextEncoder = TextEncoder; globalThis...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/layout-routes-test.tsx
packages/react-router/__tests__/layout-routes-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route, Outlet } from "react-router"; describe("A layout route", () => { it("does not match when none of its children do", () => { let renderer: TestRenderer.ReactTestRenderer; TestRenderer.act(...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/params-decode-test.tsx
packages/react-router/__tests__/params-decode-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route, useParams } from "react-router"; describe("Decoding params", () => { it("works", () => { function Content() { return <p>The params are {JSON.stringify(useParams())}</p>; } let...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/useMatch-test.tsx
packages/react-router/__tests__/useMatch-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import type { PathMatch } from "react-router"; import { MemoryRouter, Routes, Route, useMatch } from "react-router"; function ShowMatch({ pattern }: { pattern: string }) { return <pre>{JSON.stringify(useMatch(pattern), null, 2)}</pr...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/use-revalidator-test.tsx
packages/react-router/__tests__/use-revalidator-test.tsx
import "@testing-library/jest-dom"; import { fireEvent, queryByText, render, screen, waitFor, } from "@testing-library/react"; import * as React from "react"; import { Outlet, Route, RouterProvider, createMemoryRouter, createRoutesFromElements, useLoaderData, useNavigation, useRevalidator, u...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/Router-test.tsx
packages/react-router/__tests__/Router-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, useLocation } from "react-router"; describe("<Router>", () => { let consoleError: jest.SpyInstance; beforeEach(() => { consoleError = jest.spyOn(console, "error").mockImplementation(() => {}); }); a...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/absolute-path-matching-test.tsx
packages/react-router/__tests__/absolute-path-matching-test.tsx
import type { RouteObject } from "react-router"; import { matchRoutes } from "react-router"; function pickPaths(routes: RouteObject[], pathname: string): string[] | null { let matches = matchRoutes(routes, pathname); return matches && matches.map((match) => match.route.path || ""); } describe("absolute path match...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/generatePath-test.tsx
packages/react-router/__tests__/generatePath-test.tsx
import { generatePath } from "react-router"; describe("generatePath", () => { describe("with no params", () => { it("returns the unmodified path", () => { expect(generatePath("/")).toBe("/"); expect(generatePath("/courses")).toBe("/courses"); }); }); describe("with params", () => { it("r...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/useRoutes-test.tsx
packages/react-router/__tests__/useRoutes-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import type { RouteObject } from "react-router"; import { MemoryRouter, useRoutes } from "react-router"; describe("useRoutes", () => { it("returns the matching element from a route config", () => { let routes = [ { path: "...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/createRoutesFromChildren-test.tsx
packages/react-router/__tests__/createRoutesFromChildren-test.tsx
import * as React from "react"; import { Route, createRoutesFromChildren } from "react-router"; describe("creating routes from JSX", () => { it("creates a route config of nested JavaScript objects", () => { expect( createRoutesFromChildren( <Route path="/"> <Route path="home" element={<h1...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/Route-test.tsx
packages/react-router/__tests__/Route-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route } from "react-router"; describe("A <Route>", () => { it("renders its `element` prop", () => { let renderer: TestRenderer.ReactTestRenderer; TestRenderer.act(() => { renderer = TestR...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/useHref-test.tsx
packages/react-router/__tests__/useHref-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route, useHref } from "react-router"; function ShowHref({ to }: { to: string }) { return <pre>{useHref(to)}</pre>; } describe("useHref", () => { describe("to a child route", () => { it("returns ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/useNavigate-test.tsx
packages/react-router/__tests__/useNavigate-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import type { RelativeRoutingType, To } from "react-router"; import { MemoryRouter, Routes, Route, useNavigate, useLocation, createMemoryRouter, createRoutesFromElements, Outlet, RouterProvider, } from "react-router";...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/react-transitions-test.tsx
packages/react-router/__tests__/react-transitions-test.tsx
import "@testing-library/jest-dom"; import { act, fireEvent, render, screen, waitFor, } from "@testing-library/react"; import * as React from "react"; import { Outlet, RouterProvider, createMemoryRouter, useLoaderData, useNavigation, useRevalidator, } from "react-router"; import { Form, Link,...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/route-matching-test.tsx
packages/react-router/__tests__/route-matching-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import type { RouteObject } from "react-router"; import { MemoryRouter, Outlet, Routes, Route, useParams, useRoutes, } from "react-router"; describe("route matching", () => { function describeRouteMatching(routes: React....
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/useHref-basename-test.tsx
packages/react-router/__tests__/useHref-basename-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route, useHref } from "react-router"; function ShowHref({ to }: { to: string }) { return <p>{useHref(to)}</p>; } describe("useHref under a basename", () => { describe("to an absolute route", () => {...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/descendant-routes-warning-test.tsx
packages/react-router/__tests__/descendant-routes-warning-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Outlet, Routes, Route } from "react-router"; describe("Descendant <Routes>", () => { let consoleWarn: jest.SpyInstance<void, any>; beforeEach(() => { consoleWarn = jest.spyOn(console, "warn").mockImpleme...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/data-memory-router-test.tsx
packages/react-router/__tests__/data-memory-router-test.tsx
import "@testing-library/jest-dom"; import { fireEvent, queryByText, render, screen, waitFor, } from "@testing-library/react"; import * as React from "react"; import { Await, MemoryRouter, Outlet, Route, RouterProvider, Routes, createMemoryRouter, createRoutesFromElements, redirect, useAct...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/useOutlet-test.tsx
packages/react-router/__tests__/useOutlet-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route, useOutlet, useOutletContext, } from "react-router"; describe("useOutlet", () => { describe("when there is no child route", () => { it("returns null", () => { function Home() ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/server-runtime/cookies-test.ts
packages/react-router/__tests__/server-runtime/cookies-test.ts
/** * @jest-environment node */ import { createCookie, isCookie } from "../../lib/server-runtime/cookies"; function getCookieFromSetCookie(setCookie: string): string { return setCookie.split(/;\s*/)[0]; } describe("isCookie", () => { it("returns `true` for Cookie objects", () => { expect(isCookie(createCoo...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/server-runtime/utils.ts
packages/react-router/__tests__/server-runtime/utils.ts
import type { FutureConfig } from "../../lib/dom/ssr/entry"; import type { ServerRoute, ServerRouteManifest, } from "../../lib/server-runtime/routes"; import type { HandleDocumentRequestFunction, HandleErrorFunction, ServerBuild, } from "../../lib/server-runtime/build"; import type { HeadersFunction } from "....
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/server-runtime/markup-test.ts
packages/react-router/__tests__/server-runtime/markup-test.ts
import vm from "vm"; import { escapeHtml } from "../../lib/dom/ssr/markup"; describe("escapeHtml", () => { // These tests are based on https://github.com/zertosh/htmlescape/blob/3e6cf0614dd0f778fd0131e69070b77282150c15/test/htmlescape-test.js // License: https://github.com/zertosh/htmlescape/blob/0527ca7156a524d2...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/server-runtime/data-test.ts
packages/react-router/__tests__/server-runtime/data-test.ts
import { decodeViaTurboStream } from "../../lib/dom/ssr/single-fetch"; import { createRequestHandler } from "../../lib/server-runtime/server"; import { mockServerBuild } from "./utils"; describe("loaders", () => { // so that HTML/Fetch requests are the same, and so redirects don't hang on to // this param for no r...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/server-runtime/handler-test.ts
packages/react-router/__tests__/server-runtime/handler-test.ts
import { createRequestHandler } from "../../lib/server-runtime/server"; import { mockServerBuild } from "./utils"; describe("createRequestHandler", () => { it("retains request headers when stripping body off for loaders", async () => { let build = mockServerBuild({ root: { path: "/test", lo...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/server-runtime/server-test.ts
packages/react-router/__tests__/server-runtime/server-test.ts
/** * @jest-environment node */ import { createContext, type StaticHandlerContext } from "react-router"; import { createRequestHandler } from "../../lib/server-runtime/server"; import { ServerMode } from "../../lib/server-runtime/mode"; import { mockServerBuild } from "./utils"; function spyConsole() { // https:...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/server-runtime/handle-error-test.ts
packages/react-router/__tests__/server-runtime/handle-error-test.ts
import { createRequestHandler } from "../../lib/server-runtime/server"; import { ErrorResponseImpl } from "../../lib/router/utils"; import { mockServerBuild } from "./utils"; import type { HandleDocumentRequestFunction } from "../../lib/server-runtime/build"; function getHandler( routeModule = {}, opts: { hand...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/server-runtime/responses-test.ts
packages/react-router/__tests__/server-runtime/responses-test.ts
/** * @jest-environment node */ import { redirect } from "../../lib/router/utils"; describe("json", () => { it("sets the Content-Type header", () => { let response = Response.json({}); expect(response.headers.get("Content-Type")).toEqual("application/json"); }); it("preserves existing headers, includ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/server-runtime/sessions-test.ts
packages/react-router/__tests__/server-runtime/sessions-test.ts
/** * @jest-environment node */ import { createSession, isSession } from "../../lib/server-runtime/sessions"; import { createCookieSessionStorage } from "../../lib/server-runtime/sessions/cookieStorage"; import { createMemorySessionStorage } from "../../lib/server-runtime/sessions/memoryStorage"; function getCookie...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/vendor/turbo-stream-test.ts
packages/react-router/__tests__/vendor/turbo-stream-test.ts
import { decode, encode } from "../../vendor/turbo-stream-v2/turbo-stream"; import { Deferred, type EncodePlugin, } from "../../vendor/turbo-stream-v2/utils"; async function quickDecode(stream: ReadableStream<Uint8Array>) { const decoded = await decode(stream); await decoded.done; return decoded.value; } te...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/utils/MemoryNavigate.tsx
packages/react-router/__tests__/utils/MemoryNavigate.tsx
import type { HTMLFormMethod } from "../../lib/router/utils"; import { joinPaths } from "../../lib/router/utils"; import * as React from "react"; import { UNSAFE_DataRouterContext } from "../../index"; export default function MemoryNavigate({ to, formMethod, formData, children, }: { to: string; formMethod?...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/utils/getHtml.ts
packages/react-router/__tests__/utils/getHtml.ts
import { prettyDOM } from "@testing-library/react"; export default function getHtml(container: HTMLElement) { return prettyDOM(container, undefined, { highlight: false, }); }
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/utils/getWindow.ts
packages/react-router/__tests__/utils/getWindow.ts
import { JSDOM } from "jsdom"; export default function getWindow(initialUrl: string, isHash = false): Window { // Need to use our own custom DOM in order to get a working history const dom = new JSDOM(`<!DOCTYPE html>`, { url: "http://localhost/" }); dom.window.history.replaceState(null, "", (isHash ? "#" : "") ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/utils/tick.ts
packages/react-router/__tests__/utils/tick.ts
export default async function tick() { await new Promise((r) => setTimeout(r, 0)); }
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/utils/waitForRedirect.tsx
packages/react-router/__tests__/utils/waitForRedirect.tsx
export default function waitForRedirect(fn: (...args: any[]) => void) { // TODO: Hook into <Redirect> so we can know when // the redirect actually happens instead of guessing. setTimeout(fn, 100); }
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/utils/framework.ts
packages/react-router/__tests__/utils/framework.ts
import type { EntryContext, FrameworkContextObject, } from "../../lib/dom/ssr/entry"; export function mockFrameworkContext( overrides?: Partial<FrameworkContextObject>, ): FrameworkContextObject { return { routeModules: { root: { default: () => null } }, manifest: { routes: { root: { ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/utils/renderStrict.tsx
packages/react-router/__tests__/utils/renderStrict.tsx
import * as React from "react"; import * as ReactDOM from "react-dom"; let StrictMode: React.FC = function (props) { return props.children || (null as any); }; if (React.StrictMode) { StrictMode = React.StrictMode; } function renderStrict( element: | React.FunctionComponentElement<any> | React.Function...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/stub-test.tsx
packages/react-router/__tests__/dom/stub-test.tsx
import * as React from "react"; import { act, render, screen, waitFor } from "@testing-library/react"; import user from "@testing-library/user-event"; import { Form, Outlet, useActionData, useFetcher, useLoaderData, useMatches, createRoutesStub, type LoaderFunctionArgs, useRouteError, } from "../../in...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/static-location-test.tsx
packages/react-router/__tests__/dom/static-location-test.tsx
import * as React from "react"; import * as ReactDOMServer from "react-dom/server.edge"; import { Routes, Route, StaticRouter, useLocation } from "../../index"; describe("A <StaticRouter>", () => { describe("with a string location prop", () => { it("parses the location into an object", () => { let location...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/navigate-encode-params-test.tsx
packages/react-router/__tests__/dom/navigate-encode-params-test.tsx
import * as React from "react"; import * as ReactDOM from "react-dom/client"; import { act } from "@testing-library/react"; import { BrowserRouter, Routes, Route, useNavigate, useParams, } from "../../index"; describe("navigate with params", () => { let node: HTMLDivElement; beforeEach(() => { global...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/flush-sync-navigations-test.tsx
packages/react-router/__tests__/dom/flush-sync-navigations-test.tsx
import * as React from "react"; import { fireEvent, render, screen, waitFor } from "@testing-library/react"; import { createBrowserRouter, useNavigate, useSubmit, useFetcher, } from "../../index"; import { RouterProvider } from "../../lib/dom-export/dom-router-provider"; import getWindow from "../utils/getWind...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/client-on-error-test.tsx
packages/react-router/__tests__/dom/client-on-error-test.tsx
import { act, fireEvent, render, screen, waitFor, } from "@testing-library/react"; import * as React from "react"; import { Await, RouterProvider, createMemoryRouter, useFetcher, useLoaderData, useRouteError, } from "../../index"; import { createFormData, tick } from "../router/utils/utils"; imp...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/concurrent-mode-navigations-test.tsx
packages/react-router/__tests__/dom/concurrent-mode-navigations-test.tsx
import * as React from "react"; import { MemoryRouter, Routes, Route, useNavigate, BrowserRouter, HashRouter, createMemoryRouter, createRoutesFromElements, RouterProvider, } from "../../index"; import { act, fireEvent, render, screen, waitFor, } from "@testing-library/react"; import { create...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/link-click-test.tsx
packages/react-router/__tests__/dom/link-click-test.tsx
import * as React from "react"; import * as ReactDOM from "react-dom/client"; import { act } from "@testing-library/react"; import { MemoryRouter, Routes, Route, Link } from "../../index"; function click(anchor: HTMLAnchorElement, eventInit?: MouseEventInit) { let event = new MouseEvent("click", { view: window, ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/search-params-test.tsx
packages/react-router/__tests__/dom/search-params-test.tsx
import * as React from "react"; import * as ReactDOM from "react-dom/client"; import { act } from "@testing-library/react"; import { MemoryRouter, Routes, Route, useSearchParams, createBrowserRouter, useBlocker, RouterProvider, useLocation, } from "../../index"; describe("useSearchParams", () => { le...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/fetcher-submit-tagname-test.tsx
packages/react-router/__tests__/dom/fetcher-submit-tagname-test.tsx
import * as React from "react"; import { render, fireEvent, screen, waitFor } from "@testing-library/react"; import "@testing-library/jest-dom"; import { RouterProvider, createBrowserRouter, useFetcher } from "../../index"; import getWindow from "../utils/getWindow"; describe("fetcher.submit with tagName property", ()...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/special-characters-test.tsx
packages/react-router/__tests__/dom/special-characters-test.tsx
/* eslint-disable jest/expect-expect */ import * as React from "react"; import { cleanup, render, fireEvent, waitFor, screen, } from "@testing-library/react"; import type { Location, Params } from "../../index"; import { BrowserRouter, HashRouter, MemoryRouter, Link, Outlet, Routes, Route, Ro...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/useLinkClickHandler-test.tsx
packages/react-router/__tests__/dom/useLinkClickHandler-test.tsx
import * as React from "react"; import * as ReactDOM from "react-dom/client"; import { act } from "@testing-library/react"; import type { LinkProps } from "../../index"; import { MemoryRouter, Routes, Route, useHref, useLinkClickHandler, } from "../../index"; function CustomLink({ to, replace, state, target,...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/static-navigate-test.tsx
packages/react-router/__tests__/dom/static-navigate-test.tsx
import * as React from "react"; import * as ReactDOMServer from "react-dom/server.edge"; import { Navigate, Routes, Route, StaticRouter } from "../../index"; describe("A <Navigate> in a <StaticRouter>", () => { let consoleWarn: jest.SpyInstance; beforeEach(() => { consoleWarn = jest.spyOn(console, "warn").mock...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/trailing-slashes-test.tsx
packages/react-router/__tests__/dom/trailing-slashes-test.tsx
import * as React from "react"; import * as ReactDOM from "react-dom/client"; import { act } from "@testing-library/react"; import type { To } from "../../index"; import { BrowserRouter, Routes, Route, Link, Outlet, useSearchParams, useNavigate, } from "../../index"; import getWindow from "../utils/getWi...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/partial-hydration-test.tsx
packages/react-router/__tests__/dom/partial-hydration-test.tsx
import "@testing-library/jest-dom"; import { act, render, screen, waitFor } from "@testing-library/react"; import * as React from "react"; import type { LoaderFunction } from "../../index"; import { Outlet, RouterProvider as ReactRouter_RouterProvider, createBrowserRouter, createHashRouter, createMemoryRouter...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/data-static-router-test.tsx
packages/react-router/__tests__/dom/data-static-router-test.tsx
/** * @jest-environment node */ import * as React from "react"; import * as ReactDOMServer from "react-dom/server"; import type { StaticHandlerContext } from "../../index"; import { Form, Link, Outlet, useLoaderData, useLocation, useMatches, createStaticHandler, createStaticRouter, StaticRouterProv...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/dom-export-test.tsx
packages/react-router/__tests__/dom/dom-export-test.tsx
import * as React from "react"; import { render, screen } from "@testing-library/react"; import { createMemoryRouter, useParams } from "react-router"; import { RouterProvider } from "react-router/dom"; describe("react-router/dom", () => { function ShowParams() { return <pre data-testid="params">{JSON.stringify(...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/use-blocker-test.tsx
packages/react-router/__tests__/dom/use-blocker-test.tsx
import * as React from "react"; import * as ReactDOM from "react-dom/client"; import { act } from "@testing-library/react"; import type { Blocker, RouteObject } from "../../index"; import { createMemoryRouter, Link, NavLink, Outlet, RouterProvider, useBlocker, useNavigate, } from "../../index"; type Rout...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/scroll-restoration-test.tsx
packages/react-router/__tests__/dom/scroll-restoration-test.tsx
import * as React from "react"; import { render, fireEvent, screen } from "@testing-library/react"; import "@testing-library/jest-dom"; import getHtml from "../utils/getHtml"; import getWindow from "../utils/getWindow"; import { Link, Outlet, RouterProvider, ScrollRestoration, createBrowserRouter, } from ".....
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/nav-link-active-test.tsx
packages/react-router/__tests__/dom/nav-link-active-test.tsx
import { render, fireEvent, waitFor, screen } from "@testing-library/react"; import "@testing-library/jest-dom"; import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { BrowserRouter, MemoryRouter, Routes, Route, RouterProvider, NavLink, Outlet, createBrowserRouter,...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/data-browser-router-test.tsx
packages/react-router/__tests__/dom/data-browser-router-test.tsx
import { act, fireEvent, render, screen, waitFor, } from "@testing-library/react"; import * as React from "react"; import type { DataStrategyResult, ErrorResponse, Fetcher, Location, Navigation, RouteObject, } from "../../index"; import { Await, UNSAFE_DataRouterStateContext as DataRouterState...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/data-browser-router-legacy-formdata-test.tsx
packages/react-router/__tests__/dom/data-browser-router-legacy-formdata-test.tsx
// Drop support for the submitter parameter, as in a legacy browser. This // needs to be done before react-router-dom is required, since it does some // FormData detection. import "./polyfills/drop-FormData-submitter"; import * as React from "react"; import { render, fireEvent, screen } from "@testing-library/react"; i...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/link-push-test.tsx
packages/react-router/__tests__/dom/link-push-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { MemoryRouter, Routes, Route, Link, useNavigationType, } from "../../index"; function ShowNavigationType() { return <p>{useNavigationType()}</p>; } describe("Link push and replace", () => { describe("to a differ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/use-prompt-test.tsx
packages/react-router/__tests__/dom/use-prompt-test.tsx
import * as React from "react"; import "@testing-library/jest-dom"; import { fireEvent, render, screen, waitFor } from "@testing-library/react"; import { Link, RouterProvider, createBrowserRouter, unstable_usePrompt as usePrompt, } from "../../index"; import getWindow from "../utils/getWindow"; describe("usePr...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/link-href-test.tsx
packages/react-router/__tests__/dom/link-href-test.tsx
import * as React from "react"; import { BrowserRouter, HashRouter, Link, MemoryRouter, Outlet, Route, RouterProvider, Routes, createBrowserRouter, createHashRouter, } from "../../index"; import * as TestRenderer from "react-test-renderer"; describe("<Link> href", () => { describe("in a static ro...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/static-link-test.tsx
packages/react-router/__tests__/dom/static-link-test.tsx
import * as React from "react"; import * as TestRenderer from "react-test-renderer"; import { Link, StaticRouter } from "../../index"; describe("A <Link> in a <StaticRouter>", () => { describe("with a string", () => { it("uses the right href", () => { let renderer: TestRenderer.ReactTestRenderer; Tes...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/polyfills/drop-FormData-submitter.ts
packages/react-router/__tests__/dom/polyfills/drop-FormData-submitter.ts
// Drop support for the submitter parameter, as in a legacy browser. This needs // to be a standalone module due to how jest requires things (i.e. we can't // just do this inline in data-browser-router-legacy-formdata-test.tsx) window.FormData = class FormData extends window["FormData"] { constructor(form?: HTMLFormE...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/ssr/components-test.tsx
packages/react-router/__tests__/dom/ssr/components-test.tsx
import { createStaticHandler } from "react-router"; import { act, fireEvent, render } from "@testing-library/react"; import * as React from "react"; import { createMemoryRouter, Link, NavLink, Outlet, RouterProvider, } from "../../../index"; import { HydratedRouter } from "../../../lib/dom-export/hydrated-ro...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/ssr/meta-test.tsx
packages/react-router/__tests__/dom/ssr/meta-test.tsx
import { prettyDOM, render, screen } from "@testing-library/react"; import user from "@testing-library/user-event"; import * as React from "react"; import { Meta, Outlet, createRoutesStub } from "../../../index"; const getDocumentHtmlForElement = (c: HTMLElement) => prettyDOM(c.ownerDocument, undefined, { highlight...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/dom/components/LazyComponent.tsx
packages/react-router/__tests__/dom/components/LazyComponent.tsx
import * as React from "react"; export default function LazyComponent() { return <h1>Lazy</h1>; }
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/__tests__/router/ssr-test.ts
packages/react-router/__tests__/router/ssr-test.ts
/** * @jest-environment node */ import urlDataStrategy from "./utils/urlDataStrategy"; import type { StaticHandler, StaticHandlerContext, } from "../../lib/router/router"; import { createStaticHandler, getStaticContextFromError, } from "../../lib/router/router"; import { ErrorResponseImpl, isRouteErrorRe...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true