tests/testthat/test-markdown-stream.R

library(htmltools)

test_that("Chat component markup", {
  expect_snapshot(output_markdown_stream("stream"))

  expect_snapshot({
    output_markdown_stream("stream", content = "Foo\nBar")
  })

  expect_snapshot({
    render_tags(
      output_markdown_stream(
        "stream",
        content = div("Hello", htmlDependency("foo", "1.0.0", ""))
      )
    )
  })

  # TODO: it'd be nice to mock the messages that send_stream_message() sends
})

Try the shinychat package in your browser

Any scripts or data that you put into this service are public.

shinychat documentation built on June 10, 2025, 9:09 a.m.