tests/testthat/tests_capstone.R

library(software.dev.capstone)
library(testthat)

context("test functions")



##########################
# test for eq_clean_data #
##########################
#test that latitude is numeric
#setup
cleaned_data <- eq_clean_data("signif.txt")

#test that latitude is numeric
testthat::expect_that(cleaned_data$LATITUDE, testthat::is_a('numeric'))


##############################
# test for eq_location_clean #
##############################
#setup
testthat::expect_that(eq_location_clean(), throws_error())


##########################
# test for geom_timeline #
##########################
#test
testthat::expect_that(geom_timeline(), throws_error())


################################
# test for geom_timeline_label #
################################
#test
testthat::expect_that(geom_timeline_label(30), throws_error())


###################
# test for eq_map #
###################
#test
testthat::expect_that(clean_data %>%
                        dplyr::filter(COUNTRY == "MEXICO")  %>%
                        eq_map(annot_col = "COUNTRY"), testthat::is_a('leaflet'))

############################
# test for eq_create_label #
############################
#test
testthat::expect_that(eq_create_label(.), throws_error())
AESpe/R_capstone_final documentation built on Oct. 16, 2020, 12:37 a.m.