I am using mariasql 0.2.6 in my code.
Following is the sample code:
var Client = require('mariasql');
var c = new Client();
c.connect({
host: '127.0.0.1',
user: 'foo',
password: 'bar',
db: 'mydb'
});
function getData() {
c.query('SELECT * FROM users where id = 2', (err, rows) => {
if (err) {
return error;
} else {
return rows;
}
});
}
Now I'm writing unit test cases for this method and i am not sure how to stub the db call.