Skip to content

Instantly share code, notes, and snippets.

@oroce
Created February 19, 2014 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oroce/9091867 to your computer and use it in GitHub Desktop.
Save oroce/9091867 to your computer and use it in GitHub Desktop.
dummy example of mocking
describe(function(){
afterEach(function(){
removeMock( mysqlConnection, "query" );
});
it( "should return error because user doesnt exist", function(){
mock( mysqlConnection, "query", function( sql, params, cb ){
( cb||params )( null, [] );
});
userModel.getUserName( "ID13", function( err, result ){
should.exist( err );
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment