diff --git a/src/fake-timers-src.js b/src/fake-timers-src.js index c389223..94d2b4f 100644 --- a/src/fake-timers-src.js +++ b/src/fake-timers-src.js @@ -456,6 +456,10 @@ function withGlobal(_global) { }; } + ClockDate.toString = function toString() { + return NativeDate.toString(); + }; + // noinspection UnnecessaryLocalVariableJS /** * A normal Class constructor cannot be called without `new`, but Date can, so we need diff --git a/test/fake-timers-test.js b/test/fake-timers-test.js index c876ab7..321a9d4 100644 --- a/test/fake-timers-test.js +++ b/test/fake-timers-test.js @@ -3358,8 +3358,8 @@ describe("FakeTimers", function () { }); }); - it("mirrors toString", function () { - assert.same(this.clock.Date.toString, Date.toString); + it("mirrors toString output", function () { + assert.same(this.clock.Date.toString(), Date.toString()); }); });