Commit 0551e13
committed
test: replace setTimeout with promise handling for stream completion
Previously, the test used a fixed 1000ms timeout to call `done()` after handling the stream response. This approach was error-prone as the stream processing time might vary, potentially causing flaky tests or unnecessary delays.
Now, the test awaits the promise returned by `handle` (which resolves when stream processing completes) before calling `done()`. This ensures the test only finishes when the stream processing is actually complete, making the test more reliable and responsive to actual processing time.1 parent dd12a81 commit 0551e13
1 file changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 173 | + | |
| 174 | + | |
178 | 175 | | |
179 | | - | |
| 176 | + | |
180 | 177 | | |
181 | 178 | | |
182 | 179 | | |
| |||
0 commit comments