Master Test-Driven Development in Node.js

 4 Reviews Add a review

Published May 2017

Keeping it real, with real-life TDD examples

Most Node developers are familiar with Test-Driven Development (TDD), but testing in Node can be a challenge. There are a variety of testing tools and frameworks available, but learning how to choose the ones you need and employ them with a TDD mindset is an entirely separate issue.

This course will teach you how to conduct unit testing in Node.js, using a TDD approach. You’ll be able to follow along through practical, real-life examples of test driven development, using a variety of testing frameworks, such as Mocha, Chai, Nock, Sinon, Lab, and Tape. These examples will provide you with hands-on experience with each framework, allowing you to use this course to choose the framework(s) that you need for your own project.

Using these testing frameworks along with your Node.js applications will result in well-tested, robust code, ready to survive in production. Whether you’re an old pro with unit tests and test driven development, or if it’s a brand-new idea, you’ll surely find something in this course that will spark your interest and improve your Node tests!

For a concise introduction to Node, check out Node.js: An Introduction. This is a guided course into Node.js for beginners. If you’re past that stage, head on over to Responsive Web Development which builds a front-end development workflow using Node.js to create a responsive website.

Oh yeah, and the whole SitePoint library! Learn More.

What you'll learn

  • How to conduct unit testing in Node
  • How to use a TDD approach to your code
  • How to use testing frameworks such as Mocha, Chai, Sinon, lab, tape, BDD, and Nock
  • Closed captions available
Meet your instructor
David Tang

David Tang is a web developer passionate about creating great user experiences and building maintainable applications. He started off his career as a full-stack developer but has transitioned to the front-end where his passion lies. David currently works as a UI Architect at Verizon Digital Media Services and teaches web development courses at the University of Southern California, bringing the latest industry trends to the classroom to increase the skills of students from all backgrounds, not just engineers. David is the author of the book Ember Data in the Wild and a co-host on the Career.js podcast. You can find him at his blog, where he frequently writes about JavaScript, testing, and Ember Data.

Lesson 1: Unit Testing and TDD in Node.js
Your First Test with Mocha 8:17
BDD Assertions with Chai.js 8:16
Asynchronous Tests and Testing HTTP Requests with Nock 11:32
Test Doubles with Sinon.js 14:45
Testing with Lab 17:10
Testing with Tape 9:52

Leave a Review