diff --git a/types/sinon/index.d.ts b/types/sinon/index.d.ts index e110e72617..8cf995b5a9 100644 --- a/types/sinon/index.d.ts +++ b/types/sinon/index.d.ts @@ -404,6 +404,10 @@ declare namespace Sinon { * If the argument at the provided index is not available, a TypeError will be thrown. */ resolvesArg(index: number): SinonStub; + /** + * Causes the stub to return a Promise which resolves to its this value. + */ + resolvesThis(): SinonStub; /** * Causes the stub to throw an exception (Error). * @param type diff --git a/types/sinon/sinon-tests.ts b/types/sinon/sinon-tests.ts index 502e3f5fd2..8ae53c7d8e 100644 --- a/types/sinon/sinon-tests.ts +++ b/types/sinon/sinon-tests.ts @@ -404,6 +404,7 @@ function testStub() { stub.resolves(); stub.resolves('foo'); stub.resolvesArg(1); + stub.resolvesThis(); stub.throws(); stub.throws('err'); stub.throws(new Error('err'));