How do you test an Axios call to a GraphQL API in React?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/reactjs

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • SonarQube - Static code analysis for 29 languages.
  • Scout APM - Less time debugging, more time building
  • strong-mock

    Type safe mocking library for TypeScript

    Depending on how you want to check the call, you might want to use a spying library (sinon, jest.fn etc). Check out strong-mock if you're using TypeScript.

  • msw

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

    Use mock service workers to intercept network requests and reply with a predefined response you can test against.

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

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