Skip to content
RelKit
Esc
↑↓navigate↵open⌘Jpreview
On this page

Testing API

Generated public TypeScript reference for @relkit/testing.

Common APIs

For configuration and examples, read testing, first service, first route.

For a complete workflow, follow from express or hono, cache product prices, build an offline agent.

Most-used APIs

These entries carry each API’s contract and example. The complete reference follows.

invokeFunction

Invokes a function descriptor through the engine’s direct, transport-free path.

Example

import { defineFunction } from "relkit/functions";
import { z } from "relkit/schema";
import { invokeFunction } from "@relkit/testing";

export async function greetingExample(): Promise<string> {
  const greet = defineFunction({
    id: "greet",
    input: z.string(),
    output: z.string(),
    handler: async (name) => `Hello ${name}`,
  });
  return invokeFunction(greet, "Ada");
}

Signature

declare const invokeFunction: <
  const Target extends StandaloneFunctionTarget,
  Context extends { readonly signal: AbortSignal }