mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
Add resolves this to sinon stub (#29487)
* Add support for resolvesThis() to the SinonStub definition * Whitespace complaints with lint
This commit is contained in:
4
types/sinon/index.d.ts
vendored
4
types/sinon/index.d.ts
vendored
@@ -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
|
||||
|
||||
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user