yellow.js
async function yellow(
prop1,
prop2
) {
//does stuff and returns an array
return [1, 2, 3]
}
blue.js
const Yellow = require('./yellow')
async function blue(
prop1,
prop2
) {
const getIds = await Yellow(
prop1,
prop2
)
//Do stuff and return an array
return [1, 2, 3]
}
blue.test.js
it('should return an array of ids', async () => {
await blue(
1,
2
)
})
How do I stub yellow when I try to unit test blue using sinon?
I am aware of being able to stub the property of an object like sinon.stub(Yellow, 'yellow') but in this case it is throwing an error