-
Notifications
You must be signed in to change notification settings - Fork 339
Allow test_path() to work in helper files #1760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| file.path(...) | ||
| } | ||
| base <- NULL | ||
| } else if (pkgload::is_loading()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you supply the name of the package being tested as pkg here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary, since it'll be pretty rare that multiple are being loaded at the same time.
R/test-path.R
Outdated
|
|
||
| if (!dir.exists(base)) { | ||
| abort("Can't find `tests/testthat/` in current directory.") | ||
| cli::cli_abort("Can find {.path {base}}.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another example of r-lib/cli#587 where we show a .path fragment that doesn't actually exist, but it will seem clickable.
Co-authored-by: Davis Vaughan <davis@rstudio.com>
And generally improve code, tests, and docs. Closes #1756. Fixes #1562.