Mocking API calls in React Tests with Nock

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • Nock

    HTTP server mocking and expectations library for Node.js

  • We'll use a third-party package called nock that helps us to mock HTTP requests. With nock, we can specify the desired behavior of our mock HTTP requests, including the URL, headers, and body. This allows us to test our code against a known data set, making debugging and testing much more straightforward.

  • refine

    Discontinued Build your React-based CRUD applications, without constraints. [Moved to: https://github.com/refinedev/refine] (by pankod)

  • Check out refine, if you are interested in a headless framework you can use with any custom design or UI-Kit for 100% control over styling.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • fetch-mock

    Mock http requests made using fetch

  • fetch-mock: fetch-mock allows mocking HTTP requests made using fetch or a library imitating its API.

  • msw

    Seamless REST/GraphQL API mocking library for browser and Node.js.

  • MSW Mock Service Worker: Mock Service Worker is an API mocking library that uses Service Worker API to intercept actual requests.

  • miragejs

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

  • Mirage JS: Mirage JS is an API mocking library that lets you build, test, and share a complete working JavaScript application without having to rely on any backend services.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts