Nock

HTTP server mocking and expectations library for Node.js (by nock)

Nock Alternatives

Similar projects and alternatives to Nock

  1. jest

    542 Nock VS jest

    Delightful JavaScript Testing.

  2. AppSignal

    AppSignal knows why the f*#k it crashed. Stop vibe-debugging. Every exception, every backtrace, grouped so you see patterns, not noise.

    AppSignal logo
  3. axios

    508 Nock VS axios

    Promise based HTTP client for the browser and node.js

  4. public-apis

    425 Nock VS public-apis

    A collective list of free APIs

  5. Nest

    394 Nock VS Nest

    A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀

  6. telescope

    335 Nock VS telescope

    A tool for tracking blogs in orbit around Seneca's open source involvement (by Seneca-CDOT)

  7. react-router

    201 Nock VS react-router

    Declarative routing for React

  8. msw

    178 Nock VS msw

    Industry standard API mocking for JavaScript.

  9. 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.

    Kargo logo
  10. mocha

    169 Nock VS mocha

    ☕️ Classic, reliable, trusted test framework for Node.js and the browser

  11. mockoon

    59 Nock VS mockoon

    Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.

  12. apollo-client

    30 Nock VS 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.

  13. WireMock

    30 Nock VS WireMock

    A tool for mocking HTTP services

  14. vcr

    26 Nock VS vcr

    Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

  15. pact-js

    22 Nock VS pact-js

    JS version of Pact. Pact is a contract testing framework for HTTP APIs and non-HTTP asynchronous messaging systems.

  16. miragejs

    18 Nock VS miragejs

    A client-side server to build, test and share your JavaScript app

  17. gock

    12 Nock VS gock

    HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽

  18. http-proxy

    14 Nock VS http-proxy

    A full-featured http proxy for node.js

  19. node-fetch

    98 Nock VS node-fetch

    A light-weight module that brings the Fetch API to Node.js

  20. window.fetch polyfill

    25 Nock VS window.fetch polyfill

    A window.fetch JavaScript polyfill.

  21. apitest

    A simple and extensible behavioural testing library for Go. You can use api test to simplify REST API, HTTP handler and e2e tests.

  22. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better Nock alternative or higher similarity.

Nock discussion

Log in or Post with

Nock reviews and mentions

Posts with mentions or reviews of Nock. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2026-03-02.
  • msw-fetch-mock: Undici-Style Fetch Mocking for MSW
    4 projects | dev.to | 2 Mar 2026
    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
    2 projects | dev.to | 3 Jul 2025
    use nock to intercept all network requests
  • The best way for testing outbound API calls
    6 projects | dev.to | 6 Feb 2025
    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
    7 projects | dev.to | 6 Feb 2025
  • Engage Users Instantly: Embed an Interactive Demo in your React SPA
    5 projects | dev.to | 9 Jan 2025
    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
    6 projects | dev.to | 14 Nov 2024
    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
    4 projects | dev.to | 11 Nov 2024
    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
    2 projects | dev.to | 10 Nov 2024
    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
    2 projects | dev.to | 8 Nov 2024
    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
    2 projects | dev.to | 8 Nov 2024
    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
    SaaSHub helps you find the best software and product alternatives Learn more →

Stats

Basic Nock repo stats
35
13,127
6.8
6 days ago

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.


Sponsored
AppSignal knows why the f*#k it crashed.
Stop vibe-debugging. Every exception, every backtrace, grouped so you see patterns, not noise.
www.appsignal.com

Did you know that JavaScript is
the 5th most popular programming language
based on number of references?