Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

default state of clock is 0 and not the currentTimeStamp #5

Open
trcarden opened this issue Jan 17, 2013 · 1 comment
Open

default state of clock is 0 and not the currentTimeStamp #5

trcarden opened this issue Jan 17, 2013 · 1 comment

Comments

@trcarden
Copy link

With the default qunit plugin the state of all dates is initialized to 0 instead of the current timestamp.

test("", function () {
  ok((new Date()).getTime() > 0, "Time shouldn't be zero" ); //Fails
  this.clock.restore();
  ok((new Date()).getTime() > 0, "Time shouldn't be zero" ) // Passes
});
@trcarden
Copy link
Author

I can see why it might be sensical to have it default to zero (you can override the default and set it to anytime you want) but the problem with that is you can't even get the currentTimeStamp to update the clock withtout first restoring, so you can call new Date().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant