@schmock/react
v2.4.0
Published
React adapter for Schmock — Provider, hooks, and test utilities
Readme
@schmock/react
React adapter for Schmock — a Provider, a hook, and test utilities that intercept fetch.
Part of Schmock — mock APIs from OpenAPI specs or hand-crafted routes.
Install
bun add -d @schmock/reactUsage
import { schmock } from "@schmock/core";
import { SchmockProvider } from "@schmock/react";
const mock = schmock();
mock("GET /users", [{ id: 1, name: "Alice" }]);
export function App({ children }) {
return <SchmockProvider mock={mock}>{children}</SchmockProvider>;
}Documentation
License
MIT © Khalic Lab
