by RT | Mar 23, 2015 | Node.js, Software Testing
Technorati Tags: node.js,testing The code Let’s say you have a Node module (named potentialPartner.js) that returns a promise, as such: var Q = require("q"); function willYouLoveMe(cond){ var deferred = Q.defer(); if (cond === "even if I were out of...
by RT | Mar 20, 2015 | Node.js, Software Testing
When testing Node modules, one of the challenges you face is dealing with other module dependencies (either third-party modules or your own ones). Let’s say you want to test this module: var electricSaw = require("./electricSaw"), table = { wood: {} };...