tests/testthat/test_get_thread_content.R

test_that("thread URL parser works", {
  mockery::stub(parse_thread_url, 'url_to_json', thread_json)
  parsed_thread <- parse_thread_url("some_url")
  expect_equal(ncol(parsed_thread$comments), 10)
  expect_equal(ncol(parsed_thread$thread), 15)
})

Try the RedditExtractoR package in your browser

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

RedditExtractoR documentation built on March 31, 2023, 5:18 p.m.