Mocking an API request with Mock Service Worker and Typescript

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
  • blogflow.io

    Automating posting to blogging platforms like dev.to, Hashnode, and Medium

  • I'm using Blogflow.io as a means to learn Typescript while simultaneously building a tool to help automate distributing blog posts throughout the web.

  • dotenv

    Loads environment variables from .env for nodejs projects.

  • dotenv

  • 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
  • msw

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

  • Mock Service Worker (MSW) provides a simple way to intercept these API calls so that our tests aren't hitting 3rd party endpoints and interacting with live data.

  • jest

    Delightful JavaScript Testing.

  • Certain packages require additional configuration. These are primarily jest issues rather than MSW, but I ran into them while setting this up. I decided to document it incase anyone else runs into these issues like I did.

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