[nodejs] Re: Getting started with testing and using stubs

2012-03-27 Thread Rehan Iftikhar
Martin I have come to prefer that my objects emit events rather than take callbacks in method invocations. Some benefits I have seen are: - prevents nested callback spaghetti code - feels more like an interface (and therefore feels easier to unit test) Im sure there are some downsides, bu

[nodejs] Re: Getting started with testing and using stubs

2012-03-25 Thread Martin Lundberg
On Sunday, March 25, 2012 5:39:23 AM UTC+2, Rehan Iftikhar wrote: > > Hi Martin > > I was asking myself these very same questions about a year ago. What > really helped me get my head around unit testing was to read Misko > Hevery's guide to testable code: http://bit.ly/GNymAe. While the > examples

[nodejs] Re: Getting started with testing and using stubs

2012-03-24 Thread Rehan Iftikhar
Hi Martin I was asking myself these very same questions about a year ago. What really helped me get my head around unit testing was to read Misko Hevery's guide to testable code: http://bit.ly/GNymAe. While the examples are in Java, the same principles apply: embrace the Single Responsibility Prin

[nodejs] Re: Getting started with testing and using stubs

2012-03-24 Thread Rehan Iftikhar
Hi Martin I was asking myself these very same questions about a year ago. What really helped me get my head around unit testing was to read Misko Hevery's guide to testable code: http://bit.ly/GNymAe. While the examples are in Java, the same principles apply: embrace the Single Responsiblity Princ

[nodejs] Re: Getting started with testing and using stubs

2012-03-24 Thread Martin Lundberg
On Saturday, March 24, 2012 5:17:24 AM UTC+1, Eldar wrote: > > As far as I know sinon.js is the best util for > doing such kind of things. Hello Eldar, I'm sorry I don't want to seem ungrateful for your answer but it doesn't help much. I've read many articles about mockin

[nodejs] Re: Getting started with testing and using stubs

2012-03-24 Thread Eldar
As far as I know sinon.js is the best util for doing such kind of things. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups