tests/testthat/test-get_user.R

# Unit tests for get_user function

# Test 1: Invalid user ID informs user
test_that("Invalid user ID informs user", {
  expect_message(get_user(-777), "No data returned - are you sure the user ID was specified correctly?")
})

Try the sleeperapi package in your browser

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

sleeperapi documentation built on April 3, 2025, 6:13 p.m.