I have some production code that does Date.parse explicitly. When I was running my test suite using timemachine, I received the following error:
Failure/Error: TypeError: undefined is not a constructor (evaluating 'Date.parse(currentDateTime)') in http://127.0.0.1:50456/assets/services/social_hub/social_blast_validator.js?body=1?body=1 (line 244)
I propose just adding an additional method to your mock object that is the original parse function.
Note: A workaround for me was to convert my Date.parse() commands to new Date() commands.
I have some production code that does
Date.parseexplicitly. When I was running my test suite using timemachine, I received the following error:I propose just adding an additional method to your mock object that is the original
parsefunction.Note: A workaround for me was to convert my
Date.parse()commands tonew Date()commands.