Best test framework for Node in 2022?

This page summarizes the projects mentioned and recommended in the original post on /r/node

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

    output coverage reports using Node.js' built in coverage

    We use Mocha with Chai for tests - works perfectly. We use c8 for coverage, which is a drop-in replacement for nyc which doesn't (or didn't when we switch) support import. We then use husky for managing git hooks, such as ensuring all tests pass to allow a push (which can be forced through if needed).

  • mocha

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

    We use Mocha with Chai for tests - works perfectly. We use c8 for coverage, which is a drop-in replacement for nyc which doesn't (or didn't when we switch) support import. We then use husky for managing git hooks, such as ensuring all tests pass to allow a push (which can be forced through if needed).

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

  • husky

    Git hooks made easy 🐶 woof!

    We use Mocha with Chai for tests - works perfectly. We use c8 for coverage, which is a drop-in replacement for nyc which doesn't (or didn't when we switch) support import. We then use husky for managing git hooks, such as ensuring all tests pass to allow a push (which can be forced through if needed).

  • ava

    Node.js test runner that lets you develop with confidence 🚀

    We use node-tap at work which is similar to the new experimental nodejs test runner. There is also AVA which is also popular. I tend to lean more towards test runners that don’t pollute the globe namespace, that have a reduced api and rely less on mocking. If you write pure functions, then testing becomes much simpler and not much need for mocks.

  • vitest

    Next generation testing framework powered by Vite.

    Best alternatives for jest are vitest and jappa.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

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