Created
February 19, 2014 13:22
-
-
Save oroce/9091867 to your computer and use it in GitHub Desktop.
dummy example of mocking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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