dfe-analytical-services / dfeshiny

R package containing preferred methods for creating official DfE R Shiny dashboards
https://dfe-analytical-services.github.io/dfeshiny/
GNU General Public License v3.0
4 stars 1 forks source link

Add initial tests for the support_panel function #5

Closed cjrace closed 6 months ago

cjrace commented 9 months ago

These are the first unit tests we've added so hopefully lay an example for how to add them.

Added basic validation (can be improved in future!) to the team_email argument in the support_panel() function.

I used usethis::use_test("support-panel") to set up the scripts for tests and then added a few simple test case emails in there for ones that should pass, and ones that should trigger the stop message.


Edit:

This adds R CMD Check as a way to run the tests and test the package more widely using github actions. This also adds a code coverage action using https://app.codecov.io/. That will likely only start running once this branch is merged into main

rmbielby commented 6 months ago

Any reason for not setting up a workflow to run any tests on PRs?

cjrace commented 6 months ago

Any reason for not setting up a workflow to run any tests on PRs?

The workflow I think we should set up is the general R CMD check, that runs the tests amongst other things rather than just having one for our automated tests.

Happy to add that here or in a separate branch with other workflows?

cjrace commented 6 months ago

Closing in favour of a new PR