Mocking With Undici Like a Pro

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

    ☕️ simple, flexible, fun javascript test framework for node.js & the browser

    Using Mocha as our testing framework of choice, here are three example unit tests that verify the expected functionality of those two methods.

  • Nock

    HTTP server mocking and expectations library for Node.js

    Because Undici re-invents HTTP primitives and relies directly on sockets, our established mocking approaches like Nock no longer work. Luckily, Undici comes with its own built-in mocks, so we can still write unit tests against it. This post goes into detail into Undici’s mocking support, walking you through specific use-cases and examples.

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

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