tests/testthat/test-get_html_str.R

test_that("the `get_html_str()` function returns the expected output", {

  # Create a simple email object
  email <- compose_email(body = "test")

  # Expect that the extracted HTML message body
  # conforms to a regex pattern
  email %>%
    get_html_str() %>%
    expect_match("^<!doctype html>\n<html>\n.*test.*</html>$")
})

Try the blastula package in your browser

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

blastula documentation built on May 29, 2024, 4:22 a.m.