1

While coding against exercism problems' tests I noticed that RStudio's (v1.1.359 & before) Environment panel doesn't update its content when auto_test() from the testthat package is run, and neither when it fails. Setting the parameter env to environment() or globalenv() does not change this for me (R 3.4.0 on macOS).

I'm guessing this is because tests are executed other than interactively.

However, is it possible to coerse testthat to somehow update RStudio's Environment panel? So that one can get quick feedback on for example variable values when an auto_test() run fails?

Thanks for any hints :-)

Katrin Leinweber
  • 1,316
  • 13
  • 33
  • Can you provide any sort of [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) to show what you've tried and what exactly the desired result would be? – MrFlick Sep 20 '17 at 19:18
  • Any of the exercism problems can be used that way. For example: `wget https://raw.githubusercontent.com/exercism/r/master/exercises/hamming/test_hamming.R && wget https://raw.githubusercontent.com/exercism/r/master/exercises/hamming/example.R && mv example.R hamming.R`. Then, start RStudio, make the folder of the above downloads the working directory, and run `testthat::auto_test(".", ".")`. Then, introduce some error into `hamming.R`. Is the Global Environments panel updated/populated? If not, how can that be achieved. If yes, what causes that in your enviroment? – Katrin Leinweber Sep 23 '17 at 06:35

0 Answers0