test(httpapi): add route exerciser

This commit is contained in:
Kit Langton
2026-05-02 20:31:21 -04:00
committed by GitHub
parent d10fb88b66
commit fd01dc9c89
21 changed files with 2685 additions and 1013 deletions

View File

@@ -26,13 +26,17 @@ export function nextTuiRequest() {
return request.next()
}
export function submitTuiRequest(body: TuiRequest) {
request.push(body)
}
export function submitTuiResponse(body: unknown) {
response.push(body)
}
export async function callTui(ctx: Context) {
const body = await ctx.req.json()
request.push({
submitTuiRequest({
path: ctx.req.path,
body,
})

View File

@@ -122,6 +122,7 @@ export const Client = lazy(() => {
})
export function close() {
if (!Client.loaded()) return
Client().$client.close()
Client.reset()
}

View File

@@ -14,5 +14,7 @@ export function lazy<T>(fn: () => T) {
value = undefined
}
result.loaded = () => loaded
return result
}