Could you please help me understand below code? I am not able mock method using sinon, what could be wrong with it?
const amqplib = require('amqplib');
async function getMessage() {
const x = amqlib.connect({});
}
// Daemon process
getMessage();
module.exports = {
getMessage,
};
mocking code as:
const mqConnMock = sinon.stub(amqplib, 'connect');