Skip to content

Conversation

@BFalquet
Copy link
Collaborator

@BFalquet BFalquet commented Feb 5, 2026

This pull request introduces an automated approach for generating test scaffolding for functions defined in Quarto catalog files, and adds a new snapshot test for the fda-table_* functions. The changes streamline the process of creating standardized tests, making it easier to maintain and extend test coverage for catalog functions.

Automated test generation:

  • Added a new script, inst/create_tests.r, which scans Quarto catalog files for function definitions, extracts their code, and generates corresponding test files in tests/testthat using a template. This automates the creation of test scaffolding for each function, reducing manual effort and ensuring consistency.
  • Introduced a test template in inst/template_test.R that standardizes the structure of generated tests, including snapshot testing for the function's output.

Testing improvements:

  • Added a new snapshot test output for the fda-table_* functions in tests/testthat/_snaps/fda-table_*.md, capturing the expected structure and values of its summary and overall tables. This helps detect regressions in future changes.

thank you for the review

@shajoezhu shajoezhu enabled auto-merge (squash) February 6, 2026 01:15
Copy link
Collaborator

@shajoezhu shajoezhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks a lot @BFalquet

@shajoezhu shajoezhu merged commit 95575ec into pharmaverse:main Feb 6, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants