tests/testthat/test-injection.R

context("Injection")

test_that("Injected arguments on req$args get passed on.", {
  r <- pr(test_path("files/filter-inject.R"))

  expect_equal(r$call(make_req("GET", "/"))$body, jsonlite::toJSON(13))
})

Try the plumber package in your browser

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

plumber documentation built on April 3, 2025, 10:33 p.m.