-
Notifications
You must be signed in to change notification settings - Fork 6
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
Closes #96 general issue increase test coverage for dataset_vignette.R #120
Closes #96 general issue increase test coverage for dataset_vignette.R #120
Conversation
…-dataset_vignetter
test_that("dataset_vignette Test 1: a 'knitr_kable' object is output when run outside pkgdown", { | ||
# dataset_vignette | ||
## Test 1: A 'knitr_kable' object is output when run outside pkgdown ---- | ||
test_that("Test 1: A 'knitr_kable' object is output when run outside pkgdown", { |
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.
test_that("Test 1: A 'knitr_kable' object is output when run outside pkgdown", { | |
test_that("dataset_vignette Test 1: A 'knitr_kable' object is output when run outside pkgdown", { |
We actually want it the other way. :) https://pharmaverse.github.io/admiraldev/devel/articles/unit_test_guidance.html#set-up-the-test-script
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.
@zdz2101 , you can easily achieve the correct formatting by calling the "format test_that test file" addin (see https://pharmaverse.github.io/admiraldev/devel/articles/unit_test_guidance.html#addin-admiraldevformat_test_that_file).
@@ -1,23 +1,34 @@ | |||
library(admiral.test) |
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.
Can you remove this from the script
## Test 2: a 'datatables' object is output when run inside pkgdown ---- | ||
test_that("dataset_vignette Test 2: a 'datatables' object is output when run inside pkgdown", { | ||
## Test 2: A 'datatables' object is output when run inside pkgdown ---- | ||
test_that("Test 2: A 'datatables' object is output when run inside pkgdown", { | ||
Sys.setenv(IN_PKGDOWN = "true") | ||
on.exit(Sys.setenv(IN_PKGDOWN = "")) | ||
expect_s3_class(dataset_vignette(head(admiral_dm)), "datatables") |
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.
Can you also update the calls like this for test data? Or just make some simple dummy data and remove the dependency all together.
expect_s3_class(dataset_vignette(head(admiral_dm)), "datatables") | |
expect_s3_class(dataset_vignette(head(admiral.test::admiral_dm)), "datatables") |
Thanks so much for doing your first PR. Day 2!! :) |
Great to see your first PR @zdz2101! Sorry to be uber-nitpicky but in the future please use |
…r error when calling column not in dataset.
…-dataset_vignetter
## Test 3: An error is output when calling variable not in dataset ---- | ||
test_that("dataset_vignette Test 3: An error is output when calling variable not in dataset", { |
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.
## Test 3: An error is output when calling variable not in dataset ---- | |
test_that("dataset_vignette Test 3: An error is output when calling variable not in dataset", { | |
## Test 3: An error is outputted when calling variable not in dataset ---- | |
test_that("dataset_vignette Test 3: An error is outputted when calling variable not in dataset", { |
## Test 2: A 'datatables' object is output when run inside pkgdown ---- | ||
test_that("dataset_vignette Test 2: A 'datatables' object is output when run inside pkgdown", { |
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.
## Test 2: A 'datatables' object is output when run inside pkgdown ---- | |
test_that("dataset_vignette Test 2: A 'datatables' object is output when run inside pkgdown", { | |
## Test 2: A 'datatables' object is outputted when run inside pkgdown ---- | |
test_that("dataset_vignette Test 2: A 'datatables' object is outputted when run inside pkgdown", { |
## Test 1: A 'knitr_kable' object is output when run outside pkgdown ---- | ||
test_that("dataset_vignette Test 1: A 'knitr_kable' object is output when run outside pkgdown", { |
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.
## Test 1: A 'knitr_kable' object is output when run outside pkgdown ---- | |
test_that("dataset_vignette Test 1: A 'knitr_kable' object is output when run outside pkgdown", { | |
## Test 1: A 'knitr_kable' object is outputted when run outside pkgdown ---- | |
test_that("dataset_vignette Test 1: A 'knitr_kable' object is outputted when run outside pkgdown", { |
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.
Looks good. Just some grammar stuff - i was not sure how to spell outputted.
Also best practice is to put the issue #96 in the commit message |
Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.
Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the
devel
branch until you have checked off each task.styler::style_file()
to style R and Rmd filesdevtools::document()
so all.Rd
files in theman
folder and theNAMESPACE
file in the project root are updated appropriatelyNEWS.md
if the changes pertain to a user-facing function (i.e. it has an@export
tag) or documentation aimed at users (rather than developers)pkgdown::build_site()
and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.lintr::lint_package()
R CMD check
locally and address all errors and warnings -devtools::check()