tests/testthat/helper-mockapi.R

# tests/testthat/helper-mockapi.R

with_mocked_strava_api <- function(expr, mock_data = mock_activity_list_df) {
  mockery::stub(
    where = rStrava::get_activity_list,
    what = "rStrava::get_activity_list",
    how = mock_data
  )
  eval(expr)
}

Try the Athlytics package in your browser

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

Athlytics documentation built on June 8, 2025, 1:11 p.m.