Merge pull request #5448 from rogierschouten/sinon_16

Update Sinon typings for Sinon 1.16.0
This commit is contained in:
Masahiro Wakame
2015-08-22 00:52:54 +09:00
2 changed files with 21 additions and 2 deletions
+6
View File
@@ -109,3 +109,9 @@ testSix();
testSeven();
testEight();
testNine();
var clock: Sinon.SinonFakeTimers = sinon.useFakeTimers();
clock.setSystemTime(1000);
clock.setSystemTime(new Date());
+15 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for Sinon 1.8.1
// Type definitions for Sinon 1.16.0
// Project: http://sinonjs.org/
// Definitions by: William Sears <https://github.com/mrbigdog2u>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -181,7 +181,20 @@ declare module Sinon {
Date(year: number, month: number, day: number, hour: number, minute: number, second: number): Date;
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;
}
interface SinonFakeTimersStatic {
(): SinonFakeTimers;