Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Node.js Basics (2014) Building a Command Line Application Making a GET Request with http

How to do Test Driven Development for Node's asynchronous methods such as http.get?

I try to use TDD every time I can. It helps me to organize my development process and reassure me that I achieve quickly the main goal of the program early. It also pays back maintaining later on the code., because if you introduce a regression you'll get an error on your tests right away.

I am wondering how to test async methods such as http.get using testing tool like Node's built in assert, or more elaborated testing frameworks like jasmine or mocha.

Personally I'm a big fan of jasmine.

So, how would you test async methods, and which testing tools would you use to do so?