R/to_timeout.R

Defines functions to_timeout

Documented in to_timeout

#' Set timeout as an expected return on a match
#'
#' @export
#' @param .data input. Anything that can be coerced to a `StubbedRequest` class
#' object
#' @return an object of class `StubbedRequest`, with print method describing
#' the stub
#' @note see examples in [stub_request()]
to_timeout <- function(.data) {
  handle_stub_removal(.data, {
    assert_is(.data, "StubbedRequest")
    assert_stub_registered(.data)
    .data$to_timeout()
  })
  return(.data)
}

Try the webmockr package in your browser

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

webmockr documentation built on June 29, 2025, 9:06 a.m.