-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
Description
Some module e2e tests need to fake a certain date/time to be run, especially the calendar module.
There isnt (yet) a general way to mock the current date/time in the e2e tests. Only hackish solutions exist, like for the compliments module for displaying a compliment on a specific date:
Here a mockDate is in the test config which gets read in the mm-js-logic. Using test logic in normal code is of course a no-no!
There are quite a few solutions out there, like sinon, mockDate or adding a jest.mock. Alas, the author hasnt gotten any of them to run for faking a test :-(
Adding the functionality to mock a certain date/time would open up a lot of new test posibilities, for example this new feature could be tested very easily.