Error in `readers[[format]](path)`: Handling .xlsx files requires `openxlsx2` package, please install it with `install.packages('openxlsx2')`

# load dummy testing data avaialable in csv format, used to simulate other formats #
tmp_rds <- withr::local_tempfile(fileext = ".rds")
tmp_xlsx <- withr::local_tempfile(fileext = ".xlsx")
tmp_sas <- withr::local_tempfile(fileext = ".sas7bdat")
tmp_xpt <- withr::local_tempfile(fileext = ".xpt")
tmp_parquet <- withr::local_tempfile(fileext = ".parquet")
it("throws an error if file does not exist", {
expect_error(read_pk("invalid_path.csv"), "File does not exist: ")
it("throws an error if file with unsupported format is loaded", {
unsupported_path <- withr::local_tempfile(fileext = ".txt")
it("throws an error if loaded object is not a data frame", {
tmp_rds_list <- withr::local_tempfile(fileext = ".rds")
expect_error(read_pk(tmp_rds_list), "Invalid data format. Data frame was expected")
it("throws an error if loaded data frame has no rows", {
tmp_rds_empty_frame <- withr::local_tempfile(fileext = ".rds")
"Empty data frame received, please check the input file."

"throws an error if file does not exist"
"throws an error if file with unsupported format is loaded"
"throws an error if loaded object is not a data frame"
"Invalid data format. Data frame was expected"
"throws an error if loaded data frame has no rows"

Error in `readers[[format]](path)`: Handling .sas7bdat files requires `haven` package, please install it with `install.packages('haven')`

Error in `readers[[format]](path)`: Handling .xpt files requires `haven` package, please install it with `install.packages('haven')`

Error in `readers[[format]](path)`: Handling .parquet files requires `arrow` package, please install it with `install.packages('arrow')`