tests/testthat/_snaps/req-mock.md

local_mock and with_mock are deprecated

Code
  local_mock(~ response(404))
Condition
  Warning:
  `local_mock()` was deprecated in httr2 1.0.0.
  i Please use `local_mocked_responses()` instead.
Code
  . <- with_mock(NULL, ~ response(404))
Condition
  Warning:
  `with_mock()` was deprecated in httr2 1.0.0.
  i Please use `with_mocked_responses()` instead.

validates inputs

Code
  local_mocked_responses(function(foo) { })
Condition
  Error in `local_mocked_responses()`:
  ! `mock` must have the argument `req`; it currently has `foo`.
Code
  local_mocked_responses(10)
Condition
  Error in `local_mocked_responses()`:
  ! `mock` must be a function or list, not a number.


r-lib/httr2 documentation built on July 17, 2024, 4:22 p.m.