Add resolves this to sinon stub (#29487)

* Add support for resolvesThis() to the SinonStub definition

* Whitespace complaints with lint
This commit is contained in:
MrBigDog2U
2018-10-08 10:09:14 -07:00
committed by Andy
parent e605f0b1d1
commit ba0690aad3
2 changed files with 5 additions and 0 deletions

View File

@@ -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

View File

@@ -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'));