-
Notifications
You must be signed in to change notification settings - Fork 339
Description
Recently I pushed an update to one of my packages to CRAN. Before submitting, I did my usual routine of running devtools::test() and ensuring that all the tests passed. So far, no problem. However, after it was submitted (and approved), I happened to look at the package's NAMESPACE file, and realised that I had forgotten to run devtools:document() to update the list of exported functions. Because of this, a couple of functions that I had added to the package, and marked with @export directives, were not actually exported.
Is there a way of testing that functions that should be user-visible are, indeed, visible? By default testthat doesn't do this; from ?test_package:
For package tests, that environment that inherits from the package's namespace environment, so that tests can access internal functions and objects.
Hence the tests of my new functions all passed, as the testing code could see them despite not being visible to the end-user.