tests/testthat/test-empty-urls.R

# CRAN requires that URLs in the documentation are valid and not empty, including badges
test_that("No empty URLs in markdown files", {
  # Specify the path to the package directory
  package_path <- file.path(c(".", "man"))  # Adjust this if your tests directory is nested

  # Find all documentation files in the package directory
  files <- list.files(package_path, pattern = "\\.Rmd$|\\.md$|\\.Rd$", recursive = TRUE, full.names = TRUE)

  # Check each markdown file for empty URLs
  for (file in files) {
    empty_urls <- check_empty_urls(file)

    # Expect no empty URLs in the file
    expect_length(empty_urls, 0)
  }
})

Try the fio package in your browser

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

fio documentation built on April 11, 2025, 6:11 p.m.