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())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.