Open andysontran opened 1 month ago
Use testthat package to implement unit tests for sawmill package, aiming for 50% test coverage by end of 2024-06
testthat
[ ] Create and store tests in tests/testthat/test-function name.R (automatically generated by usethis::use_test("function name"); refer to https://r-pkgs.org/testing-basics.html#create-a-test)
usethis::use_test("function name")
[ ] Use snapshot tests to record expected results (refer to https://r-pkgs.org/testing-basics.html#sec-snapshot-tests)
[ ] Check test coverage using covr package (refer to https://covr.r-lib.org/)
covr
Using the diffviewer package by calling testthat::snapshot_review('read_timber/') following a failed test, we can view the changes in .CSV output for the respective function being tested.
diffviewer
testthat::snapshot_review('read_timber/')
Use
testthat
package to implement unit tests for sawmill package, aiming for 50% test coverage by end of 2024-06[ ] Create and store tests in tests/testthat/test-function name.R (automatically generated by
usethis::use_test("function name")
; refer to https://r-pkgs.org/testing-basics.html#create-a-test)[ ] Use snapshot tests to record expected results (refer to https://r-pkgs.org/testing-basics.html#sec-snapshot-tests)
[ ] Check test coverage using
covr
package (refer to https://covr.r-lib.org/)