refactor: Rewrite test with mock timer using got/async#1785
Merged
paulmelnikow merged 4 commits intomasterfrom Oct 29, 2019
Merged
refactor: Rewrite test with mock timer using got/async#1785paulmelnikow merged 4 commits intomasterfrom
paulmelnikow merged 4 commits intomasterfrom
Conversation
paulmelnikow
commented
Oct 29, 2019
| done() | ||
| }) | ||
| const req = got('http://example.test/') | ||
| clock.tick() |
Member
Author
There was a problem hiding this comment.
clock.tick() was the key to making this work.
Member
There was a problem hiding this comment.
It's unclear to me at a glance if creating the date var before the clock.tick() is important.
If it's not, could we move it down to just above the assertion that uses it?
Member
Author
There was a problem hiding this comment.
It would be better if it were after the clock.tick() and I've moved it. I'm surprised that it can be just before the assertion and still work, though it seems to! Happy to keep it there. I don't feel like this mock timers business is something I need to fully grasp.
Closed
mastermatt
approved these changes
Oct 29, 2019
Collaborator
|
🎉 This PR is included in version 11.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
juninmd
pushed a commit
to juninmd/nock
that referenced
this pull request
Mar 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.