Replies: 2 comments
-
Hey, Yeah testing golem is a bit weird — the test suite moves to different folders and loads namespaces because well, golem is a package to manage package :) Testthat calls pkgload::load_all(), something that golem does too, and golem tries to unload namespaces so it can be a bit messy from time to time. I usually recommend using a test that runs outside the current R session, for example via a new terminal or if you're an RStudio button with the 'test' button. Another thing you can try is restarting R between each test run, so that you're sure you're in a clean state. That being said, I do feel like the library(golem) should be removed from the helper config file. |
Beta Was this translation helpful? Give feedback.
-
I have been able to make progress the testing problems that I had been experiencing. I'll describe my method since it varies from @ColinFay 's method above. I am using RStudio to create and edit functions and tests.
Any further changes to the function would require reloading the functions with I'm curious to know if there are other methods for testing and would appreciate any ideas for improving the testing process for this package. Thank you for your assistance. |
Beta Was this translation helpful? Give feedback.
-
I am working on modifying some of the functions in this package along with writing associate tests using
testthat
. However, when I make a change to a function and write new tests, the unmodified versision of the function is being loaded. I believe this is because of thelibrary(golem)
command in helper-config.R. However, if I disable thelibrary(golem)
command, the workflows fails before my tests execute.The only workaround I can see is renaming the functions I am changing to something not in the namespace of
golem
. However, that seems less than ideal.I am wondering if someone could guide me towards a more appropriate method for developing and testing this package? Please let me know if you need any additional information.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions