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

Time forward testing #36

Closed
maggiepint opened this issue Jul 10, 2017 · 4 comments
Closed

Time forward testing #36

maggiepint opened this issue Jul 10, 2017 · 4 comments
Labels

Comments

@maggiepint
Copy link
Member

Libraries like Moment provide a way to override the "current time" with a function of one's choice for the purpose of time-forward testing.

Do we provide a way to do this or just let people monkey patch the instant object?

@apaprocki
Copy link
Contributor

Do people usually do that testing from Node or in the browser? It seems like something that needs to be provided by the engine host environment rather than from within the script itself so that it would also affect Date (and anything else, like native modules) and not just the new API.

@maggiepint
Copy link
Member Author

I make heavy use of NodaTime's IClock interface in my .NET code. It isn't exactly proper 'time forward' testing where the entire environment is rolled forward, but it can still be used to test paths around leap year and DST transitions - which I find quite useful.

@domenic
Copy link
Member

domenic commented Jul 10, 2017

It seems problematic to introduce such a feature without heavy host integration. E.g. what is its impact on setTimeout, event.timeStamp, etc. I'd suggest leaving it out of this proposal; it has enough weight to be a large proposal in its own, and if done properly will require stakeholders outside TC39.

@pipobscure
Copy link
Collaborator

Can we close this as unwanted? Especially in light of the debate in #73 ?

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

4 participants