tests/testthat/test.nhl_process_players_seasons.R

context("nhl_process_player_seasons")

testthat::test_that(
  "Process empty data",
  testthat::expect_equal(
    nhl_process_player_seasons(list(), 1L),
    data.frame(playerId = integer(0), seasonStart = integer(0))
  )
)


context("nhl_process_players_seasons")

testthat::test_that(
  "Process empty data",
  testthat::expect_equal(
    nhl_process_players_seasons(list(list()), 1L),
    data.frame()
  )
)

Try the nhlapi package in your browser

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

nhlapi documentation built on Feb. 20, 2021, 9:06 a.m.