when jasmine clock is installed and date is mocked new Date() instanceof Date should equal true

This commit is contained in:
Misha Chernetsov
2014-09-24 15:07:22 -07:00
parent 6d10f97151
commit 62840f72a6
2 changed files with 5 additions and 0 deletions

View File

@@ -417,6 +417,8 @@ describe("Clock (acceptance)", function() {
clock.install().mockDate();
expect(new global.Date() instanceof global.Date).toBe(true);
var now = new global.Date().getTime();
clock.tick(50);
@@ -443,6 +445,8 @@ describe("Clock (acceptance)", function() {
clock.install().mockDate(baseTime);
expect(new global.Date() instanceof global.Date).toBe(true);
var now = new global.Date().getTime();
expect(now).toEqual(baseTime.getTime());

View File

@@ -61,6 +61,7 @@ getJasmineRequireObj().MockDate = function() {
}
function createDateProperties() {
FakeDate.prototype = GlobalDate.prototype;
FakeDate.now = function() {
if (GlobalDate.now) {