I want to write unit tests with sinon for async.parallel.
My code looks like this:
async.parallel(async.reflectAll(fns), function (err,res) {
console.log("err", err) // Nothing shows here
}
);
I tried to stub the async.parallel using sinon like this:
const stubbedModule = sinon.stub(require.cache[require.resolve('async')],
'parallel', () => {
return 'I\'m stubbed!';
});
But that doesn't work. When I consoled inside the body of the async.parallel function, nothing goes there, no error, no results. I am so confused on how to stub the parallel method of async.