DEV Community

Discussion on: Jest for Sinon Stubs

Collapse
 
2ezpz2plzme profile image
Steven Liao

What callback are you talking about? Got an example?

Collapse
 
afsarzan profile image
Afsar
sinon.stub(object, 'methodName').callsFake((param,cb) => {
cb(param);
})
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
2ezpz2plzme profile image
Steven Liao
jest.spyOn(object, 'methodName').mockImplementation((param, cb) => {
  cb(param)
})
Enter fullscreen mode Exit fullscreen mode

Does that work?

Thread Thread
 
afsarzan profile image
Afsar

No. It says this expression is not callable. cb: unknow param