Our great sponsors
-
supertest
🕷 Super-agent driven library for testing node.js HTTP servers using a fluent API. Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
-
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.
-
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.
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.
Last but not least important are ava, uvu and tape; they are a really light and fast test runners.
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.
Last but not least important are ava, uvu and tape; they are a really light and fast test runners.
Last but not least important are ava, uvu and tape; they are a really light and fast test runners.
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.
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 adds the capability to make HTTP requests to Chai while keep using the assertion functions from Chai
Integration test with jest and supertest E2E test with jest and Pactum
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.
Integration test with jest and supertest E2E test with jest and Pactum
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