hi,
I would like to test. I really would like to test, but I simply can't get
my head around even the simplest call made in my main server file
e.g. I would like to test the following
in server.js
app.get('/user', login_required, function(req, res) {
// req.user is set, and a JSON object is returned from it
});
in test.js
describe('user profile', function(){
describe('if not logged in', function() {
it('can not be accessed', function(){
// what to do here?
var res = app.get('/user');
if (res.status == 403) done();
else throw 'Wrong status code';
});
});
});
Could someone give me a solution on how to do the above test?
After checking many testing frameworks, I think I prefer Mocha, but I would
be extremely happy to see how to test the above code with different testing
tools.
Viktor
--
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 "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en