@frontal-labs/testing
v1.0.1
Published
Frontal testing utilities and helpers
Downloads
30
Readme
@frontal-labs/testing
Testing utilities for Frontal SDK packages.
Installation
bun add -d @frontal-labs/testing vitestProvides
createMockFetchcreateTestClientcreateTestHttpClient- response factories (for pagination/errors)
- fixture builders (
agent,entity,workflow, ...)
Usage
import { createTestHttpClient, mockPageResponse } from "@frontal-labs/testing";
import { GraphService } from "@frontal-labs/graph";
const { http, mock } = createTestHttpClient([
{ method: "GET", path: "/graph/entities/user", body: mockPageResponse([]) },
]);
const graph = new GraphService(http);
await graph.use("user").list();
mock.expectCalled("GET", "/graph/entities/user");