tests/README.md

GERDA Package Test Suite

This directory contains comprehensive tests for the GERDA package, written using the testthat framework.

Test Structure

The test suite is organized into the following files:

test-gerda_data_list.R

Tests for the gerda_data_list() function:

test-load_gerda_web.R

Tests for the load_gerda_web() function:

Note: These tests focus on parameter validation and error handling rather than actual data downloading, to avoid network dependencies during testing.

test-party_crosswalk.R

Tests for the party_crosswalk() function:

test-integration.R

Integration tests demonstrating typical package workflows:

Running the Tests

To run the complete test suite:

# Install and load required packages
library(devtools)

# Run all tests
test()

# Or run specific test files
test_file("tests/testthat/test-gerda_data_list.R")

Test Coverage

The test suite includes 164 individual test cases covering:

Expected Test Results

When all tests pass, you should see output similar to:

[ FAIL 0 | WARN 0 | SKIP 0 | PASS 164 ]

Test Philosophy

These tests are designed to:

  1. Validate functionality - Ensure all functions work as documented
  2. Prevent regressions - Catch breaking changes during development
  3. Document expected behavior - Serve as executable specifications
  4. Handle edge cases - Test boundary conditions and error scenarios
  5. Support CI/CD - Enable automated testing in development workflows

Dependencies

The tests require the following packages:

Optional dependencies:



Try the gerda package in your browser

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

gerda documentation built on Nov. 13, 2025, 1:07 a.m.