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
·
nock avatar

nock/nock

0
View on GitHub↗

Nock

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, and headers, as well as the management of mock lifecycles. The tool provides outbound request control to block all outgoing traffic except for specifically allowed hostnames.

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

Features

  • Network Request Interceptors - Intercepts outgoing HTTP requests to redirect traffic to predefined mock responses instead of a live server.
  • HTTP Mocking - Intercepts outgoing HTTP requests in Node.js to return predefined responses, decoupling application logic from external servers.
  • Request Matching - Matches requests using hostnames, paths, verbs, or headers through strings and regular expressions.
  • Request Matchers - Evaluates a collection of defined mock patterns against every intercepted HTTP call to determine the response.
  • API Response Simulators - Defines return status codes and response bodies using strings, JSON, or callbacks to simulate API behavior.
  • HTTP Mocking Libraries - Provides a comprehensive library for intercepting outgoing HTTP requests and returning predefined responses in Node.js.
  • API Expectation Frameworks - Functions as a framework to verify that specific HTTP calls were made with correct parameters and headers.
  • API Integration Testing - Enables verification that an application sends correct HTTP requests and handles various server responses within automated suites.
  • HTTP Interaction Recording - Captures real HTTP interactions as fixtures to replay them for deterministic offline testing.
  • Mock Interaction Recorders - Captures real network interactions as fixtures to be replayed in future test runs.
  • API Request Mocking - Intercepts network requests to simulate server responses and decouple code from external dependencies.
  • HTTP Interaction Recorders - Captures real network interactions as fixtures that can be replayed in future test environments.
  • Request Interception and Blocking - Captures outgoing calls to specific hosts and paths to return predefined responses instead of contacting live servers.
  • HTTP Request Interceptors - Captures outgoing network traffic to specific hosts and paths to prevent calls to live external servers.
  • Network Access Control - Blocks all outgoing HTTP requests to non-mocked hosts or allows specific hostnames to bypass the interceptor.
  • Outbound Network Blockers - Blocks all outgoing network traffic except for specifically allowed hostnames to prevent accidental external API calls during tests.
  • Error Simulation Utilities - Introduces artificial latency and triggers network errors to test how the application handles failures.
  • Dynamic Response Callbacks - Provides the ability to use JavaScript functions to generate dynamic, request-aware mock responses.
  • Mock State Resetting - Provides utilities for removing specific interceptors or clearing all active mocks to reset the test environment.
  • Request Verification - Inspects properties of outgoing requests to ensure they meet expected parameters and specifications.
  • Network Connectivity Controls - Restrict connections to specific hostnames to prevent accidental external network requests during testing.
  • Network Outbound Blocklists - Prevents accidental external network calls by blocking all outgoing traffic that does not match a mock.
  • Network Resilience Simulators - Introduces artificial latency and triggers network errors to verify application timeout and failure handling.
  • Response Simulators - Returns custom status codes and headers with timing delays to mimic various server response behaviors.
  • Lifecycle Management - Clears interceptors and restores original network behavior to reset the environment between test scenarios.
  • State Expectation Validation - Maintains a queue of pending requests to verify that specific API calls were made before tests complete.
  • Frameworks de test - HTTP server mocking and request expectations.
13,103 stars·757 forks·JavaScript·MIT·7 vues

Historique des stars

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

Questions fréquentes

Que fait nock/nock ?

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.

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

Les fonctionnalités principales de nock/nock sont : Network Request Interceptors, HTTP Mocking, Request Matching, Request Matchers, API Response Simulators, HTTP Mocking Libraries, API Expectation Frameworks, API Integration Testing.

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

Les alternatives open-source à nock/nock incluent : pgte/nock — Nock is a Node.js HTTP mocking library used to intercept outgoing network requests and return predefined responses. It… alisoftware/ohhttpstubs — OHHTTPStubs is an HTTP network mocking library and request interceptor used to simulate server responses for testing… getsentry/responses — Responses is a Python mocking library designed to intercept outgoing HTTP calls made with the Requests library to… bblimke/webmock — WebMock is a Ruby library for HTTP request stubbing, response simulation, and network interception. It serves as a… netflix/pollyjs — Pollyjs is an HTTP mocking and recording library designed to capture and replay network interactions to create… wheresrhys/fetch-mock — Fetch-mock is a testing utility designed to isolate application code from external network dependencies by…

Alternatives open source à Nock

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

    pgte/nock

    13,108Voir sur GitHub↗

    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 prov

    JavaScript
    Voir sur GitHub↗13,108
  • 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
  • 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
  • bblimke/webmockAvatar de bblimke

    bblimke/webmock

    4,050Voir sur GitHub↗

    WebMock is a Ruby library for HTTP request stubbing, response simulation, and network interception. It serves as a test assertion framework for verifying outgoing HTTP traffic and a network interception layer that blocks external connections to prevent accidental requests during testing. The project provides capabilities for dynamic response generation and the sequencing of different return values for repeated requests to the same endpoint. It supports simulating network failures, such as timeouts or exceptions, and allows for response replays using raw HTTP data loaded from local files. The

    Ruby
    Voir sur GitHub↗4,050
Voir les 30 alternatives à Nock→