How can I test an EventStream
?
#2804
Unanswered
RemiBardon
asked this question in
Questions
Replies: 1 comment 5 replies
-
Yes. You will want to take advantage of If you didn't use |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a route which returns an
EventStream
, how can I get the events in tests?rocket::local::asynchronous::LocalRequest::dispatch
returns aLocalResponse
and I see no way to read events from it. Getting the response body returns an empty string, and there is no other API to get the stream AFAIK.I tried sleeping before reading the body, it doesn't work either.Edit: I tried yielding a static event in the
EventStream
and I see it in the response body. I can probably decode a list of events then.Beta Was this translation helpful? Give feedback.
All reactions