awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
pgte avatar

pgte/nock

0
View on GitHub↗
13,108 stars·757 forks·JavaScript·MIT·20 views

Nock

Nock is a Node.js HTTP mocking library used to intercept outgoing network requests and return predefined responses. It functions as a network request interceptor and HTTP mock server, allowing developers to simulate external API behavior for automated testing without making live network calls.

The project includes an API fixture recorder to capture real network interactions and save them as reusable data files for playback. It also features a network latency simulator that introduces artificial delays to outgoing HTTP responses to verify timeout handling and race conditions.

The library provides capabilities for integration test isolation by blocking unplanned outbound traffic and restricting requests to unmocked hosts. It supports network request validation to verify the parameters and headers sent to specific endpoints, and employs request matching filters to target dynamic hostnames, paths, and request bodies.

Features

  • API Request Mocking - Provides tools to intercept network requests and simulate server responses to mimic external API behavior.
  • Response Recordings - Returns pre-recorded fixtures or predefined data packets to the application instead of making live network calls.
  • Request Matching Engines - Employs a matching engine to target dynamic hostnames, paths, and request bodies for selecting correct mock responses.
  • Network Request Interceptors - Captures and redirects outbound traffic to simulate external API behavior for automated testing.
  • HTTP Mocking Libraries - Provides a Node.js library for intercepting outgoing HTTP requests and returning predefined responses.
  • API Response Recordings - Provides a utility to record real network interactions and save them as reusable data files for playback.
  • HTTP Mock Servers - Functions as a simulated server environment that validates request expectations and returns mock data.
  • Network Fixture Recorders - Captures real HTTP interactions from a live system to create reusable mock data for development and testing.
  • Network Interaction Recorders - Captures real network interactions and saves them as reusable data files for playback during tests.
  • Response Simulators - Simulates specific server behaviors, such as custom error codes or artificial network latency, to test application resilience.
  • HTTP Mocking - Intercepts network requests to return predefined responses and isolate application logic from external services.
  • Mock Expectation Verifiers - Validates that specific network requests occurred and asserts that all expected calls were completed.
  • Request-Response Interceptors - Redirects traffic from the native network stack to a virtual response handler based on the target hostname.
  • Request Validation - Verifies that the application sends the correct parameters and headers to specific endpoints.
  • Module Monkey Patching - Overrides core Node.js HTTP and HTTPS modules to intercept outgoing requests before they reach the network.
  • Outbound Network Blockers - Blocks requests to unmocked hosts to prevent unexpected outbound network calls during test execution.
  • Network Latency Simulators - Introduces artificial delays to outgoing HTTP responses to verify timeout handling and race conditions.
  • Test Isolation - Prevents external dependencies from affecting test results by simulating API behavior and blocking unplanned outbound traffic.
  • Mock State Resetting - Maintains a global map of active mocks and expectations that can be cleared or reset between test cycles.
  • Latency and Chunking Simulators - Introduces configurable millisecond delays to HTTP responses to verify timeout handling and race conditions.
  • Lifecycle Management - Provides controls to start, stop, or reset network interceptors to maintain a clean state between test scenarios.
  • Testing Frameworks - HTTP mocking and expectations.

Star history

Star history chart for pgte/nockStar history chart for pgte/nock

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Nock

Similar open-source projects, ranked by how many features they share with Nock.
  • nock/nocknock avatar

    nock/nock

    13,103View on GitHub↗

    nock is a Node.js HTTP mocking library and request interceptor. It captures outgoing network traffic to specific hosts and paths, returning predefined responses to decouple applications from external servers during automated testing. The project functions as an API expectation framework to verify that specific calls were made with correct parameters. It includes a traffic recorder that captures real network interactions as fixtures for playback and a network simulation tool to introduce artificial latency or trigger network errors. Its capabilities cover request matching via hostnames, paths

    JavaScripthttpjavascriptmock
    View on GitHub↗13,103
  • getsentry/responsesgetsentry avatar

    getsentry/responses

    4,350View on GitHub↗

    Responses is a Python mocking library designed to intercept outgoing HTTP calls made with the Requests library to return predefined simulated responses. It functions as a request verification framework and a network simulation tool, allowing for the verification of application behavior against various API response patterns without making real network calls. The project distinguishes itself through a traffic recorder that captures real network interactions and saves them to files for deterministic replay. It further enables the simulation of complex network scenarios, including the triggering

    Pythontag-production
    View on GitHub↗4,350
  • requestly/requestlyrequestly avatar

    requestly/requestly

    6,341View on GitHub↗
    TypeScriptapiapi-clientapi-mock
    View on GitHub↗6,341
  • alisoftware/ohhttpstubsAliSoftware avatar

    AliSoftware/OHHTTPStubs

    5,068View on GitHub↗

    OHHTTPStubs is an HTTP network mocking library and request interceptor used to simulate server responses for testing application behavior without a live backend. It functions as a network request stubbing tool that captures outgoing network calls and replaces them with predefined mock data, custom status codes, and headers. The library distinguishes itself through its ability to simulate a wide range of network conditions, including artificial latency and connection failures. It supports dynamic response sequencing, allowing the tool to return a series of different responses for the same requ

    Objective-Ciosmockmock-server
    View on GitHub↗5,068
See all 30 alternatives to Nock→

Frequently asked questions

What does pgte/nock do?

Nock is a Node.js HTTP mocking library used to intercept outgoing network requests and return predefined responses. It functions as a network request interceptor and HTTP mock server, allowing developers to simulate external API behavior for automated testing without making live network calls.

What are the main features of pgte/nock?

The main features of pgte/nock are: API Request Mocking, Response Recordings, Request Matching Engines, Network Request Interceptors, HTTP Mocking Libraries, API Response Recordings, HTTP Mock Servers, Network Fixture Recorders.

What are some open-source alternatives to pgte/nock?

Open-source alternatives to pgte/nock include: nock/nock — nock is a Node.js HTTP mocking library and request interceptor. It captures outgoing network traffic to specific hosts… getsentry/responses — Responses is a Python mocking library designed to intercept outgoing HTTP calls made with the Requests library to… requestly/requestly. alisoftware/ohhttpstubs — OHHTTPStubs is an HTTP network mocking library and request interceptor used to simulate server responses for testing… wheresrhys/fetch-mock — Fetch-mock is a testing utility designed to isolate application code from external network dependencies by… dreamhead/moco — moco is a multi-protocol mock server and programmable API stub used to simulate HTTP, REST, WebSocket, and Server-Sent…