Request for 'done' event
See original GitHub issueIs there a done
event that can be listened to on a scope. I want to test multiple parallel requests where I short-circuit on an error and polling for the isDone method seems like a bad idea.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:14 (7 by maintainers)
Top Results From Across the Web
javascript - How to listen for Request complete event? Or how ...
Now I need to do something based on a status of a response object. But I would like to continue in my for...
Read more >Event follow up email templates - LiveAgent
Send a follow-up email to find out how your event performed. For inspirational words, check out our free event follow-up templates.
Read more >API - Request | Tedious
An done event is emited for each SQL statement in the SQL batch except variable declarations. For execution of SQL statements within stored...
Read more >Event System - Guzzle Documentation
All events in Guzzle are managed and emitted by an event emitter. ... example registers event listeners to the before and complete event...
Read more >Using a Request Object Event Listener - AWS Documentation
The complete event is raised when a service object call has finished, regardless of whether the call results in success or error. Here...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For what its worth, I actually reversed this design in my test suite. What I do is create my scoped nock mock, then run my test, and when the test finishes I clear the existing scope. I detailed how I did this in https://github.com/nock/nock/issues/1495, but the basic gist is this:
I am assuming you wanted a done event so you could perform some cleanup, log something, or just determine that your test has ended. Ive found that this design works better and makes more sense. The test itself should determine when the test ends, and you should rely on it to trigger your “I am done now” type events.
I am looking for an event to add a listener to. Otherwise I need to keep polling
nock
to know when it is done.Something like: