diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index d5eb228c95..9f57219b84 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -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 () {