Create sinon-as-promised.d.ts (#9638)

* Create sinon-as-promised.d.ts

* Rename sinon-as-promised reject parameter
This commit is contained in:
igrayson
2016-06-19 02:21:17 +09:00
committed by Masahiro Wakame
parent d28aa3ff18
commit 0f5d541ed3
2 changed files with 34 additions and 0 deletions
@@ -0,0 +1,11 @@
/// <reference path="sinon-as-promised.d.ts"/>
function testResolve() {
sinon.stub().resolves('test val');
}
function testReject() {
sinon.stub().rejects('test val');
}
testResolve();
testReject();
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for sinon-as-promised v4.0.0
// Project: https://github.com/bendrucker/sinon-as-promised
// Definitions by: igrayson <https://github.com/igrayson>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../sinon/sinon.d.ts"/>
declare namespace Sinon {
export interface SinonStub {
/**
* When called, the stub will return a "thenable" object which will return a promise for the provided value. Any Promises/A+ compliant library will handle this object properly.
*/
resolves(value:any):SinonStub;
/**
* When called, the stub will return a thenable which will return a reject promise with the provided err. If err is a string, it will be set as the message on an Error object.
*/
rejects(err:any):SinonStub;
}
}