Sinon - How to stub authentication library (Authy -Twilio)
问题 I am currently new to Sinon, Mocha, Supertest and in the process to writes tests. In my current scenario, i have authentication library which verifies my "OTP" and after verifying it proceeds to do operation within the callback function. I am unable to mock the callback to return null and carry on to test rest of the code. Following is my code snippet: Controller.js var authy = require('authy')(sails.config.authy.token); authy.verify(req.param('aid'), req.param('oid'), function(err, response)