mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 20:21:46 +00:00
Create sinon-as-promised.d.ts (#9638)
* Create sinon-as-promised.d.ts * Rename sinon-as-promised reject parameter
This commit is contained in:
committed by
Masahiro Wakame
parent
d28aa3ff18
commit
0f5d541ed3
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user