tests/testthat/helper-api-mocks.R

mock_st_response <- function(payload) {
  httr2::response(
    status_code = 200,
    body = charToRaw(jsonlite::toJSON(payload, auto_unbox = TRUE))
  )
}

expect_no_title_level_requests <- function(urls) {
  forbidden <- c(
    "ranking",
    "top_and_trending",
    "sales_report",
    "apps/timeseries",
    "app_ids",
    "unified_app_ids"
  )
  pattern <- paste(forbidden, collapse = "|")
  testthat::expect_false(any(grepl(pattern, urls)))
}

Try the sensortowerR package in your browser

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

sensortowerR documentation built on May 14, 2026, 5:06 p.m.