SaaSHub helps you find the best software and product alternatives Learn more →
Nock Alternatives
Similar projects and alternatives to Nock
-
-
AppSignal
AppSignal knows why the f*#k it crashed. Stop vibe-debugging. Every exception, every backtrace, grouped so you see patterns, not noise.
-
-
-
Nest
A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
-
telescope
A tool for tracking blogs in orbit around Seneca's open source involvement (by Seneca-CDOT)
-
-
-
Kargo
Stop Scripting Promotions. Start Shipping with Kargo. Kargo automates promotion across dev, staging, and prod with approval gates and verification. Open source, built by the team behind Argo CD. Download now.
-
-
mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
-
apollo-client
The industry-leading GraphQL client for TypeScript, JavaScript, React, Vue, Angular, and more. Apollo Client delivers powerful caching, intuitive APIs, and comprehensive developer tools to accelerate your app development.
-
-
vcr
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
-
pact-js
JS version of Pact. Pact is a contract testing framework for HTTP APIs and non-HTTP asynchronous messaging systems.
-
-
-
-
-
-
apitest
A simple and extensible behavioural testing library for Go. You can use api test to simplify REST API, HTTP handler and e2e tests.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Nock discussion
Nock reviews and mentions
-
msw-fetch-mock: Undici-Style Fetch Mocking for MSW
When writing frontend or Node.js tests, mocking HTTP requests is practically mandatory. But choosing a mock solution is overwhelming: MSW, nock, fetch-mock, jest-fetch-mock… each has a different API style, interception level, and environment support. If you work on both Cloudflare Workers and Node.js projects, you'll find the mock APIs are completely different and test code can't be shared.
-
Backend Testing At Super Payments
use nock to intercept all network requests
-
The best way for testing outbound API calls
mocha is a lib inspired by nock and WireMock. It allows checking if the mock was called or not, which is a nice feature. Like httptest, it also it don't automatically intercept the requests.
- Testando chamadas para APIs da melhor forma
-
Engage Users Instantly: Embed an Interactive Demo in your React SPA
I used mock-apollo-client; for REST or tRPC, you might use something like nock. They're meant for automated testing but are exactly what we need here.
-
Effective Strategies for Writing Unit Tests with External Dependencies like Databases and APIs
For testing third-party API calls, you can use libraries such as WireMock or Nock. These tools allow you to simulate HTTP requests and responses, helping you test how your application behaves when interacting with an external service. For example, you can mock successful responses, simulate errors, or test timeouts, all without making real HTTP requests.
-
Learning from My Own Tests
My program uses the OpenAI client to interface with various LLMs, including OpenRouter, Groq, and GPT. To test this functionality, we were encouraged to use an HTTP mocking library like Nock, but it made more sense to me to mock the OpenAI client in Jest using jest.mock. In order to do this, I had to move the initialization for the OpenAI client to a separate file so that the instance could be imported and mocked in tests.
-
Testing LLM Applications: Misadventures in Mocking SDKs vs Direct HTTP Requests
As I tried to add more comprehensive tests, I ran into an interesting realization about how my application communicates with LLMs. Initially, I thought I could use Nock.js to mock the HTTP requests to these language models. After all, that's what Nock is great at - intercepting and mocking HTTP requests for testing.
-
Lab 7 - Jest Testing
I had never used Nock before this assignment, nor did I know what Nock is/was. Nock is a "server mocking and expectations library for Node.js". In this project, I used it to simulate my project connecting to the Ollama API in the test suite, where I could then test my main function without running an Ollama instance. The documentation can be found here
-
Adding Jest to dev-mate-cli
The biggest challenge was simulating AI responses from OpenAI's API. Initially, I tried using nock to intercept HTTP requests, but while researching I found that OpenAI had mocking capabilities for its constructor , which let me use captured JSON responses to simulate interactions with the model.
-
A note from our sponsor - SaaSHub
www.saashub.com | 15 Sep 2026
Stats
nock/nock is an open source project licensed under MIT License which is an OSI approved license.
The primary programming language of Nock is JavaScript.