jest
.spyOn(webService.prototype, 'isEnabled')
.mockImplementation(() => {
return Promise.resolve(true)
})
jest
.spyOn(webService.prototype, 'isEnabled')
.mockImplementation(() => {
return Promise.resolve(false)
})
So what I want is to return 'true' if parameter has 'YES' string in it. and return 'false' if parameter has 'NO' in it.
the typescript of function is like below..
public isEnabled(featureId: string): Promise<boolean> {
return this.toggle.isEnabled(featureId)
}