Skip to content

Commit

Permalink
Add (failing) edge case to sse unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheng5 committed Sep 4, 2024
1 parent 3e3b0d8 commit 96d96a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/testthat/test-req-perform-stream.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ test_that("can join sse events across multiple reads", {
app$get("/events", function(req, res) {
res$send_chunk("data: 1\n")
Sys.sleep(0.2)
res$send_chunk("data")
Sys.sleep(0.2)
res$send_chunk(": 2\n")
res$send_chunk("\n\n")
})
server <- webfakes::local_app_process(app)
Expand All @@ -96,7 +99,7 @@ test_that("can join sse events across multiple reads", {
Sys.sleep(0.1)
out <- resp_stream_sse(resp1)
}
expect_equal(out, list(type = "message", data = "1", id = character()))
expect_equal(out, list(type = "message", data = c("1", "2"), id = character()))
expect_equal(resp1$cache$push_back, character())

# Blocking waits for a complete event
Expand Down

0 comments on commit 96d96a6

Please sign in to comment.