I am trying to write sinon test case for ibm_db2 in my node js app. My node js code to connect to db looks like this. Can anyone suggest a way to mock this using sinon/mocha test scripts.
var db = require(ibm_db);
var config={};//All db params are in config
var connection = db.openSync(config);
function getConnection(){
if(connection == null || connection == undefined){
connection = db.openSync(config);
}
return connection.
}
exports.getConnection = getConnection;
Aucun commentaire:
Enregistrer un commentaire