From 49a913ca80f2ac0cbf20fc3eef5b73d4d9c7f083 Mon Sep 17 00:00:00 2001 From: Josh Hollinshead Date: Tue, 13 Aug 2019 08:43:07 +1200 Subject: [PATCH] Fix the acceptance test slowdown mentioned in this issue: https://github.com/Ticketfly/ember-mockdate-shim/issues/3 The original now function in backburner calls the now function on the on the Date object itself, whereas this library currently invokes the Date object instead, returning a Date instance that is more costly - especially when called frequently. --- addon/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/index.js b/addon/index.js index 2e87aba..3894aa7 100644 --- a/addon/index.js +++ b/addon/index.js @@ -20,7 +20,7 @@ const { set, reset } = MockDate || { * https://github.com/BackburnerJS/backburner.js/pull/264 */ const freezeDateAt = (...args) => { - trySet(Ember, 'run.backburner._platform.now', () => originalDate()); + trySet(Ember, 'run.backburner._platform.now', originalDate.now); set(args); };