Describe the bug
This was working in 7.3.2, but broke in 7.4.1.
Basically, when calling sinon.stub().resolves(...) as part of the second argument of sinon.createStubInstance(), I get undefined. It works as a standalone, however.
To Reproduce
Steps to reproduce the behavior:
Run the following test:
class X {
async test() {
return Promise.resolve(1)
}
}
it('is a buggy test', async () => {
const thing = sinon.createStubInstance(X, {
test: sinon.stub().resolves(2) as sinon.SinonStub<[], Promise<number>>
})
console.log(thing.test()) // undefined
}
Expected behavior
I would expect the console.log(thing.test()) to output 2
Screenshots
N/A
Context (please complete the following information):
- Library version: 7.4.1
- Environment: Mac OSX
- Example URL: n/a
- Other libraries you are using: n/a
Additional context
N/A
Describe the bug
This was working in 7.3.2, but broke in 7.4.1.
Basically, when calling
sinon.stub().resolves(...)as part of the second argument ofsinon.createStubInstance(), I getundefined. It works as a standalone, however.To Reproduce
Steps to reproduce the behavior:
Run the following test:
Expected behavior
I would expect the
console.log(thing.test())to output2Screenshots
N/A
Context (please complete the following information):
Additional context
N/A