-
Notifications
You must be signed in to change notification settings - Fork 8
Improve testthat code coverage #290
Copy link
Copy link
Open
Description
Each .R file in the application should have a .R file in the testhat folder.
For example, TADAShiny/R/mod_filter.R has tests within TADAShiny/tests/testthat/test-mod_filter.R. In the coverage report, we can see that test coverage for the code in TADAShiny/R/mod_filter.R is already at 80%.
For others, the code coverage is 0%. Ideally, all files would have good code coverages via applicable tests.
The coverage report can be re-produced in R:
> cov <- covr::package_coverage(quiet = FALSE, clean = FALSE)
* installing *source* package 'TADAShiny' ...
** this is package 'TADAShiny' version '0.0.0.9000'
** using non-staged installation
** R
** inst
** tests
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'TADAShiny'
** building package indices
** testing if installed package can be loaded
* DONE (TADAShiny)
Running specific tests for package ‘TADAShiny’
Running ‘spelling.R’
Running ‘testthat.R’
> print(cov)
TADAShiny Coverage: 32.97%
R/app_server.R: 0.00%
R/mod_flag_fct_helpers.R: 0.00%
R/mod_load_fct_helpers.R: 0.00%
R/mod_load_map_bbox_fct_helpers.R: 0.00%
R/mod_summary2_fct_helpers.R: 0.00%
R/run_app.R: 0.00%
R/mod_review_scatterplots.R: 10.60%
R/mod_flag.R: 16.94%
R/mod_review_pie.R: 17.95%
R/mod_censored.R: 20.88%
R/mod_harmonize.R: 26.60%
R/mod_summary2.R: 27.91%
R/mod_overview.R: 43.92%
R/mod_load_map_bbox.R: 46.33%
R/mod_load.R: 46.62%
R/app_config.R: 48.84%
R/mod_filter.R: 50.32%
R/mod_summary.R: 73.08%
R/app_server_fct_helpers.R: 77.78%
R/mod_load_upload_data.R: 90.00%
R/app_ui.R: 100.00%Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels