How to Succeed with Node.js Testing
summary
Shows how moving business logic out of controllers into plain functions and using express + mongoose as the example reduces test toil and avoids spinning up servers for every check. Replaces heavy service objects with a higher-order function pattern to pass only needed dependencies, so tests mock only real external calls (metrics) and stay meaningful. Recommends pragmatic integration tests, end-to-end with CodeceptJS + Gherkin or Cypress/Playwright, and a state builder to speed E2E flows, plus test segmentation for parallel CI.
AI-written summary · about
chapters (4)
related talks
37mTesting in the Node.js World
31mGreat Expectations – Understanding nodejs Testing Frameworks
01h 02mWriting better tests for your JavaScript app
25mMaking JavaScript Tests Fast, Easy, and Friendly
30mNodeJS: Patterns and Tools to Ship to Production with Confidence
56mIf You Won't Test Your Code, Who Will?
27mBuilt-in Tests with Node.js
29mTesting Is All About Principles
