Skip to content

Instantly share code, notes, and snippets.

@alexnj
Created March 8, 2014 20:43
Show Gist options
  • Save alexnj/9438579 to your computer and use it in GitHub Desktop.
Save alexnj/9438579 to your computer and use it in GitHub Desktop.
Unit test
var db = require('../lib/db');
exports = module.exports = {};
exports.findAll = function(req, res) {
db.query('select * from users', function(err,rows){
res.send({'users':rows});
});
};
exports.findById = function(req, res, next) {
res.send('{"user":{"id":"123","email":"[email protected]"}');
next();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment