tests/testthat/test_handler_adding.R

library(jug)

context("testing handler adding")

test_that("handlers are correctly added to the jug instance",{
  j<-
    jug() %>%
    get("/", function(req, res){"test"})

  expect_equal(length(j$middleware_handler$middlewares), 1)
})

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.