Starter Templates
Jumpstart your API gateway development process with our pre-built starter templates
Templates
Mocking & Unit Test
Create unit tests by mocking Zuplo objects.
Testing
Repository
zuplo/examples/test-mocksRun Locally
npx create-zuplo-api --example test-mocks
Zuplo Mocking & Unit Test Sample#
This sample shows how to mock ZuploRequest
and ZuploContext
in order to write unit tests. This sample uses mocha and sinon, but the concepts apply to any test and mocking tool.
See the handlers.spec.ts
file for details.
Use this example locally#
To develop with this example locally, you can create a new Zuplo project using our CLI
npx create-zuplo-api@latest my-api --example test-mocks
Then, in the project directory run the following commands:
npm install
npm run dev
You can start the tests by running:
npm run unit
Other Examples
Jumpstart your API gateway development process with our pre-built starter templates
Remote MCP Server with OAuth
A remote MCP Server that shows how to setup OAuth authentication with Auth0
Dev Portal with API Keys
An example of a Zuplo Dev Portal with support for self-serve API key creation.
Remote MCP Server
Create a remote MCP server for an API with authentication and additional security policies.
API Linting
See how to use API linting to enforce api consistency and require Zuplo features like policies.