-
Recent Posts
Archives
Categories
Meta
Tag Archives: javascript
sinon vs rewire: when do I use which?
In node.js testing, there are 2 helper modules that I use often: sinon and rewire. Sinon allows you to monkey-patch functions, while rewire allows you to… monkey-patch functions. Both modules have other uses as well, but in this post I’m … Continue reading
Posted in JavaScript, node.js, software development, testing
Tagged javascript, monkey patch, monkey-patching, node.js, rewire, sinon, testing, unit test
1 Comment
Automated software testing part 6: stubbing
Previous: part 5 You can also find the code below in the src/unit-test-4 dir of my blog code repository. In the previous post, we talked about spying. With a test spy, you can spy on method calls and see how … Continue reading
Posted in software development, testing
Tagged amsterdam, javascript, node.js, sinon, stub, stubbing, testing, unit testing, weather
Leave a comment
Automated software testing part 2: testing strategy, or what to test
Previous: part 1 – Next: part 3 If you have done or read anything about unit testing, I’m sure you’ve encountered the standard example of a function that multiplies two numbers and returns the result. This function is pretty easy to test. Once … Continue reading
Posted in software development, testing
Tagged automated testing, javascript, test strategy, testing, unit testing, unit tests
Leave a comment
Combining mongoose and Q in node.js
This post will teach you how to write promise-based mongoose code, using Kris Kowal’s Q library. You can also find the code below in the `src/mongoose-and-q` dir of my blog code repository. We have a mongo database with 3 collections: users, … Continue reading
Posted in JavaScript, node.js, software development
Tagged array of promises, callback, javascript, mongo, mongoose, node, node.js, promise, promises, q
4 Comments
Processing an array of promises sequentially in node.js
This post describes how you can perform a sequence of promises sequentially – one after another – using Kriskowal’s Q library in node.js. If you’re just interested in how to do this, and not in the other examples, scroll down … Continue reading
Posted in JavaScript, node.js, software development
Tagged array of promises, javascript, library, node.js, nodejs, promise, promises, q, sequential, serial, upload, upload file, uploading files sequentially
6 Comments