tests/testthat/test_static_file_server.R

library(jug)

context("testing static file server middleware")

test_req<-RawTestRequest$new()
test_req$path("/")



test_that("The static file is loaded correctly",{
  res<-
    jug() %>%
    serve_static_files() %>%
    simple_error_handler() %>%
    process_test_request(test_req$req)

  expect_true(grepl("test", res$body))
})

Try the jug package in your browser

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

jug documentation built on May 1, 2019, 10:31 p.m.