R Under development (unstable) (2024-01-10 r85799 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(testthat) > library(kickR) > > # Bundesliga > # Test for a valid season and type > test_that("Fetching data for a valid season and type", { + result <- fbref_bundesliga_team_stats(season = "2022/2023", type = "standard") + expect_is(result, "data.frame") + expect_equal(ncol(result), 32) + expect_equal(nrow(result), 18) + }) Test passed 🥳 > > # Premier League > > # Test for a valid season and type > test_that("Fetching data for a valid season and type", { + result <- fbref_epl_team_stats(season = "2022/2023", type = "standard") + expect_is(result, "data.frame") + expect_equal(ncol(result), 32) + expect_equal(nrow(result), 20) + }) Test passed 🎊 > > # Eredivisie > > # Test for a valid season and type > test_that("Fetching data for a valid season and type", { + result <- fbref_eredivisie_team_stats(season = "2022/2023", type = "standard") + expect_is(result, "data.frame") + expect_equal(ncol(result), 32) + expect_equal(nrow(result), 18) + }) Test passed 🥇 > > # La Liga > # Test for a valid season and type > test_that("Fetching data for a valid season and type", { + result <- fbref_la_liga_team_stats(season = "2022/2023", type = "standard") + expect_is(result, "data.frame") + expect_equal(ncol(result), 32) + expect_equal(nrow(result), 20) + }) Test passed 🌈 > > # Ligue 1 > # Test for a valid season and type > test_that("Fetching data for a valid season and type", { + result <- fbref_ligue1_team_stats(season = "2022/2023", type = "standard") + expect_is(result, "data.frame") + expect_equal(ncol(result), 32) + expect_equal(nrow(result), 20) + }) Test passed 😸 > > # Primeira Liga > # Test for a valid season and type > test_that("Fetching data for a valid season and type", { + result <- fbref_primeira_liga_team_stats(season = "2022/2023", type = "standard") + expect_is(result, "data.frame") + expect_equal(ncol(result), 32) + expect_equal(nrow(result), 18) + }) Test passed 🥇 > > # Serie A > # Test for a valid season and type > test_that("Fetching data for a valid season and type", { + result <- fbref_serie_a_team_stats(season = "2022/2023", type = "standard") + expect_is(result, "data.frame") + expect_equal(ncol(result), 32) + expect_equal(nrow(result), 20) + }) Test passed 😀 > > # T5 leagues players > # Test to check if the number of rows returned is more than 1500 > test_that("Fetching data with more than 1500 rows", { + result <- fbref_big5_player_stats(season = "2022/2023", type = "possession") + expect_is(result, "data.frame") + expect_equal(ncol(result), 30) + expect_true(nrow(result) > 1500) + }) Test passed 😸 > > proc.time() user system elapsed 3.68 0.43 45.78