[nodejs] Getting started with testing and using stubs

2012-03-23 Thread Martin Lundberg
Hi! I'm having problems getting up and running with testing my node.js code. I've got a file called auth.js with a function that looks like: authenticate(email, password, callback). The authenticate function tries to fetch a user with the given e-mail using a collaborator UserRepository object

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

2012-03-24 Thread Martin Cooper
On Fri, Mar 23, 2012 at 3:35 PM, Martin Lundberg wrote: > Hi! > > I'm having problems getting up and running with testing my node.js code. There are many ways to do this, depending, to some extent, on how you choose to write your tests. One option would be to use Mockery with your choice of unit

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

2012-03-24 Thread Nuno Job
Nock is what you are looking for: - http://github.com/flatiron/nock Nuno On Sat, Mar 24, 2012 at 5:25 PM, Martin Cooper wrote: > On Fri, Mar 23, 2012 at 3:35 PM, Martin Lundberg > wrote: > > Hi! > > > > I'm having problems getting up and running with testing my node.js code. > > There ar

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

2012-03-24 Thread Martin Lundberg
On Saturday, March 24, 2012 6:25:35 PM UTC+1, Martin Cooper wrote: > > On Fri, Mar 23, 2012 at 3:35 PM, Martin Lundberg wrote: > > Hi! > > > > I'm having problems getting up and running with testing my node.js code. > > There are many ways to do this, depending, to some extent, on how you > choose

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

2012-03-24 Thread Martin Lundberg
On Saturday, March 24, 2012 6:57:20 PM UTC+1, Nuno Job wrote: > > Nock is what you are looking for: > > >- http://github.com/flatiron/​nock > > > Nuno > Have you actually read the discussion before you answered? :) Nock seems to be for mocking http requests w