Fix sinon's usingPromise return type definition (#16305)

* Fix sinon's usingPromise return type definition

* Fix alignment according to new dtslint rule
This commit is contained in:
Lukas Spieß 2017-05-03 22:19:31 +02:00 committed by Mohamed Hegazy
parent d27680e385
commit 5ddccbbc61
2 changed files with 17 additions and 17 deletions

View File

@ -102,7 +102,7 @@ declare namespace Sinon {
interface SinonStub extends SinonSpy {
resetBehavior(): void;
resetHistory(): void;
usingPromise(promiseLibrary: any): void;
usingPromise(promiseLibrary: any): SinonStub;
returns(obj: any): SinonStub;
returnsArg(index: number): SinonStub;
@ -203,19 +203,19 @@ declare namespace Sinon {
Date(year: number, month: number, day: number, hour: number, minute: number, second: number, ms: number): Date;
restore(): void;
/**
* Simulate the user changing the system clock while your program is running. It changes the 'now' timestamp
* without affecting timers, intervals or immediates.
* @param now The new 'now' in unix milliseconds
*/
setSystemTime(now: number): void;
/**
* Simulate the user changing the system clock while your program is running. It changes the 'now' timestamp
* without affecting timers, intervals or immediates.
* @param now The new 'now' as a JavaScript Date
*/
setSystemTime(date: Date): void;
}
/**
* Simulate the user changing the system clock while your program is running. It changes the 'now' timestamp
* without affecting timers, intervals or immediates.
* @param now The new 'now' in unix milliseconds
*/
setSystemTime(now: number): void;
/**
* Simulate the user changing the system clock while your program is running. It changes the 'now' timestamp
* without affecting timers, intervals or immediates.
* @param now The new 'now' as a JavaScript Date
*/
setSystemTime(date: Date): void;
}
interface SinonFakeTimersStatic {
(): SinonFakeTimers;
@ -415,7 +415,7 @@ declare namespace Sinon {
reset(): void;
resetHistory(): void;
resetBehavior(): void;
usingPromise(promiseLibrary: any): void;
usingPromise(promiseLibrary: any): SinonSandbox;
verify(): void;
verifyAndRestore(): void;
}

View File

@ -92,6 +92,7 @@ function testNine() {
function testSandbox() {
let sandbox = sinon.sandbox.create();
sandbox = sandbox.usingPromise(Promise);
sandbox.assert.notCalled(sinon.spy());
@ -106,7 +107,6 @@ function testSandbox() {
sandbox.reset();
sandbox.resetHistory();
sandbox.resetBehavior();
sandbox.usingPromise(Promise);
sandbox.verify();
sandbox.verifyAndRestore();
}
@ -130,7 +130,7 @@ function testResetHistory() {
}
function testUsingPromises() {
sinon.stub().usingPromise(Promise);
const stub: sinon.SinonStub = sinon.stub().usingPromise(Promise);
}
function testSpy() {