tests/testthat/test-application.R

context("Testing application methods")

test_that("test note_preview", {
  
  expect_equal(
    note_preview("**hello**, *world* \n\n Hey!"),
    "<p><strong>hello</strong>, <em>world</em></p>\n<p>Hey!</p>"
  )
  
  ## unclosed tags do not cause error:
  expect_equal(
    note_preview("**hello**, this is *incomplete"),
    "<p><strong>hello</strong>, this is *incomplete</p>"
  )
  
  expect_error(note_preview(c("Hello", "World")))
  expect_error(note_preview(1L))
})
strboul/shinyNotes documentation built on June 2, 2019, 10:56 p.m.