Express API Testing

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

    🕷 Super-agent driven library for testing node.js HTTP servers using a fluent API. Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.

  • Supertest is quite popular and easy to use test tool, you can do integration and E2E test as well, you just need to pass it the server instance or a string to make a request and assert over the response.

  • nodejs-integration-tests-best-practices

    ✅ Beyond the basics of Node.js testing. Including a super-comprehensive best practices list and an example app (March 2024)

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

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

  • Last but not least important are ava, uvu and tape; they are a really light and fast test runners.

  • vitest

    Next generation testing framework powered by Vite.

  • Vitest is a close competitor to Jest, it's faster and younger than jest, and it use vite under the hood to work, so for pure Node.js apps (100% backend) could have some caveats with ES modules.

  • uvu

    uvu is an extremely fast and lightweight test runner for Node.js and the browser

  • Last but not least important are ava, uvu and tape; they are a really light and fast test runners.

  • tape

    tap-producing test harness for node and browsers

  • Last but not least important are ava, uvu and tape; they are a really light and fast test runners.

  • Sinon.JS

    Test spies, stubs and mocks for JavaScript.

  • Mocha is a test runner, Chai is an assertion library, Sinon is a mocking library, this normally the combination you would need to use if you choose mocha, but there are others.

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

    WorkOS logo
  • pactum

    REST API Testing Tool for all levels in a Test Pyramid

  • Pactum is quite powerful allowing different kind of E2E tests, you pass the base URL to make a request and assert over the response, it has more assertion functions than supertest and also supports GraphQL

  • chai-http

    HTTP Response assertions for the Chai Assertion Library.

  • chai-http adds the capability to make HTTP requests to Chai while keep using the assertion functions from Chai

  • fakeshop-api

    Minimal API RESTful with MongoDB and tested with Jest

  • Integration test with jest and supertest E2E test with jest and Pactum

  • mocha

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

  • Mocha is a test runner, Chai is an assertion library, Sinon is a mocking library, this normally the combination you would need to use if you choose mocha, but there are others.

  • nest-api-example

    Example of an Restful API with Nest.js and TypeORM

  • Integration test with jest and supertest E2E test with jest and Pactum

  • jest

    Delightful JavaScript Testing.

  • Jest is a test framework because it already includes the test runner, assertion and mocking functions, it's quite popular because you don't need to wire anything to start executing tests, but it has some caveats

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