Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change how the Date object is fixed in tests #961

Closed
faboweb opened this issue Jul 13, 2018 · 2 comments
Closed

Change how the Date object is fixed in tests #961

faboweb opened this issue Jul 13, 2018 · 2 comments
Labels

Comments

@faboweb
Copy link
Collaborator

faboweb commented Jul 13, 2018

UI Version: 0.7.1

Description:

Ref: https://github.com/cosmos/voyager/pull/952/files/a6736f42db3b2c8258b8e06b5d1d05c141e9c3ca#diff-48654224d7b96335593ca66a7728c572R1
@NodeGuy

@NodeGuy NodeGuy changed the title Change how the data object is fixed in tests Change how the Date object is fixed in tests Jul 13, 2018
@faboweb faboweb removed the discuss label Jul 24, 2018
@faboweb faboweb removed the technical label Oct 17, 2018
@sabau
Copy link
Contributor

sabau commented Jan 4, 2019

Can we use the normal date and override only when needed with i.e.

jest.spyOn(Date, `now`).mockImplementation(() => 43000)

Or, if some suite is heavily affected, at beforeEach / afterEach setting and restoring Date

@faboweb
Copy link
Collaborator Author

faboweb commented Jan 4, 2019

Uhh that's a very good idea :)

@sabau sabau added bug 🐛 issues related to unhandled errors in the code that need to be fixed and removed bug 🐛 issues related to unhandled errors in the code that need to be fixed labels Feb 5, 2019
@faboweb faboweb reopened this Feb 12, 2019
@faboweb faboweb closed this as completed Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants