mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 13:30:28 +00:00
Adds typing for sinon-stub-promise
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
/// <reference path="sinon-stub-promise.d.ts"/>
|
||||
function testResolve() {
|
||||
var promise = sinon.stub().returnsPromise();
|
||||
promise.resolves('test val');
|
||||
}
|
||||
|
||||
function testReject() {
|
||||
var promise = sinon.stub().returnsPromise();
|
||||
promise.rejects('test val');
|
||||
}
|
||||
|
||||
testResolve();
|
||||
testReject();
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for sinon-stub-promise v1.0.1
|
||||
// Project: https://github.com/substantial/sinon-stub-promise
|
||||
// Definitions by: Thiago Temple <https://github.com/vintem>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../sinon/sinon.d.ts"/>
|
||||
|
||||
declare module Sinon {
|
||||
interface SinonPromise {
|
||||
resolves(value?: any): void;
|
||||
rejects(value?: any): void;
|
||||
}
|
||||
|
||||
interface SinonStub {
|
||||
returnsPromise(): SinonPromise;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user