Simnaril
Simnaril helps you build realistic simulations of third-party HTTP services. The simulations run in memory and in the same Node.js process as your application, so you can arrange their state directly and step into them with a debugger.
Getting startedBuild a small simulated API and call it through ordinary fetch requests.
GitHubSource code, issues and releases for Simnaril.
Install
Section titled “Install”pnpm add -D @kensio/simnarilSimnaril is intended for tests and local development. Application code keeps using the same production-style URLs and HTTP client it uses outside the simulation.
The basic workflow
Section titled “The basic workflow”Create the simulated API once, seed the world each test needs, run ordinary application code, and inspect the resulting state.
const sim = createApplicationSim();
sim.example.widgets.seed({ id: "widget-123", name: "Before",});
await application.renameWidget("widget-123", "After");
expect(sim.example.widgets.get("widget-123").name).toBe("After");The test describes the state of the simulated service. It does not configure a one-off response or assert how many times an HTTP method was called.