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

Découvrez les meilleurs dépôts open-source grâce à notre recherche par IA.

ExplorerRecherches sélectionnéesAlternatives open sourceLogiciels auto-hébergésBlogPlan du site
ProjetÀ proposNotre méthodologiePresseServeur MCP
Mentions légalesConfidentialitéConditions d'utilisation
© 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·4 vues

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.
  • Frameworks de test - HTTP mocking and expectations.

Historique des stars

Graphique de l'historique des stars pour pgte/nockGraphique de l'historique des stars pour pgte/nock

Recherche par IA

Explorez plus de dépôts awesome

Décrivez vos besoins en langage naturel — l'IA classe des milliers de projets open source sélectionnés par pertinence.

Start searching with AI

Questions fréquentes

Que fait pgte/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.

Quelles sont les fonctionnalités principales de pgte/nock ?

Les fonctionnalités principales de pgte/nock sont : API Request Mocking, Response Recordings, Request Matching Engines, Network Request Interceptors, HTTP Mocking Libraries, API Response Recordings, HTTP Mock Servers, Network Fixture Recorders.

Quelles sont les alternatives open-source à pgte/nock ?

Les alternatives open-source à pgte/nock incluent : 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…

Alternatives open source à Nock

Projets open source similaires, classés selon le nombre de fonctionnalités partagées avec Nock.
  • nock/nockAvatar de nock

    nock/nock

    13,103Voir sur 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
    Voir sur GitHub↗13,103
  • getsentry/responsesAvatar de getsentry

    getsentry/responses

    4,350Voir sur 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
    Voir sur GitHub↗4,350
  • requestly/requestlyAvatar de requestly

    requestly/requestly

    6,341Voir sur GitHub↗
    TypeScriptapiapi-clientapi-mock
    Voir sur GitHub↗6,341
  • alisoftware/ohhttpstubsAvatar de AliSoftware

    AliSoftware/OHHTTPStubs

    5,068Voir sur 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
    Voir sur GitHub↗5,068
  • Voir les 30 alternatives à Nock→