Skip to content
Myr

testing.ts

This file

Path

examples/burrow/packages/kit/src/testing.ts

21 lines · 541 bytes · TypeScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 678c8b8 point at it.

Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8

lines 1–21why, one step back
1import type { Transport } from "./transport.ts";
23/**4 * A transport that answers from a table of URL to body, and 404 for any URL5 * not in it. It records each URL it was asked for.6 */7export const fakeTransport = (routes: ReadonlyMap<string, string>) => {8 const asked: string[] = [];910 const transport: Transport = (url) => {11 asked.push(url);1213 const text = routes.get(url);1415 return Promise.resolve(16 text === undefined ? { status: 404, text: "" } : { status: 200, text }17 );18 };1920 return { asked, transport };21};