Welcome to ClientVPS Mirrors

Quick Start: Generating Idempotent test_that() Listings with Sections

Quick Start: Generating Idempotent test_that() Listings with Sections

Rafal Urniaz

2025-10-16

Overview

This vignette demonstrates a robust, idempotent workflow for generating a roxygen2-style inventory of all test_that() calls in one test file. The function:

Quick Start

library(testthatdocs)

res <- document_file(
  path = system.file("examples", "tests_sample_before.R", package="testthatdocs"),
  section_prefix = "# -",
  template = "advanced",   # or "simple"
  encoding = "UTF-8",
  backup = TRUE,
  write = TRUE
)

# Summary of tests 
res$listing

# Modified test file 
res$text

```

The result includes:

Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.

This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.