mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add test for Jasmine's jasmine.clock().mockDate(baseTime)
This commit is contained in:
parent
147cc7a8b3
commit
bcf0b2807b
@ -721,6 +721,17 @@ describe("Manually ticking the Jasmine Clock", function () {
|
||||
jasmine.clock().tick(50);
|
||||
expect(timerCallback.calls.count()).toEqual(2);
|
||||
});
|
||||
|
||||
describe("Mocking the Date object", function(){
|
||||
it("mocks the Date object and sets it to a given time", function() {
|
||||
var baseTime = new Date(2013, 9, 23);
|
||||
|
||||
jasmine.clock().mockDate(baseTime);
|
||||
|
||||
jasmine.clock().tick(50);
|
||||
expect(new Date().getTime()).toEqual(baseTime.getTime() + 50);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("Asynchronous specs", function () {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user