awesome-repositories.com
Blog
awesome-repositories.com

Entdecke die besten Open-Source-Repositories mit KI-gestützter Suche.

EntdeckenKuratierte SuchenOpen-Source-AlternativenSelf-hosted SoftwareBlogSitemap
ProjektÜber unsRanking-MethodikPresseMCP-Server
RechtlichesDatenschutzAGB
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
nock avatar

nock/nock

0
View on GitHub↗
13,103 Stars·757 Forks·JavaScript·MIT·6 Aufrufe

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.

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.
  • Test-Frameworks - HTTP server mocking and request expectations.

Star-Verlauf

Star-Verlauf für nock/nockStar-Verlauf für nock/nock

KI-Suche

Entdecke weitere awesome Repositories

Beschreibe in einfachen Worten, was du brauchst — die KI bewertet tausende kuratierte Open-Source-Projekte nach Relevanz.

Start searching with AI

Häufig gestellte Fragen

Was macht 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.

Was sind die Hauptfunktionen von nock/nock?

Die Hauptfunktionen von nock/nock sind: Network Request Interceptors, HTTP Mocking, Request Matching, Request Matchers, API Response Simulators, HTTP Mocking Libraries, API Expectation Frameworks, API Integration Testing.

Welche Open-Source-Alternativen gibt es zu nock/nock?

Open-Source-Alternativen zu nock/nock sind unter anderem: 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…

Open-Source-Alternativen zu Nock

Ähnliche Open-Source-Projekte, sortiert nach der Anzahl der gemeinsamen Funktionen mit Nock.
  • pgte/nockAvatar von pgte

    pgte/nock

    13,108Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗13,108
  • alisoftware/ohhttpstubsAvatar von AliSoftware

    AliSoftware/OHHTTPStubs

    5,068Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗5,068
  • getsentry/responsesAvatar von getsentry

    getsentry/responses

    4,350Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗4,350
  • bblimke/webmockAvatar von bblimke

    bblimke/webmock

    4,050Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗4,050
Alle 30 Alternativen zu Nock anzeigen→