Hi, I really like the idea of snapshot tests.
It is weird for me to think about all kinds of expect_* for my functions, so I wonder why not always using snapshot tests for every single function? What are the drawbacks of snapshots tests?
Hi, I really like the idea of snapshot tests.
It is weird for me to think about all kinds of expect_* for my functions, so I wonder why not always using snapshot tests for every single function? What are the drawbacks of snapshots tests?
I think there are a couple of reasons not to use snapshot tests:
There are possibly more.
Thanks! It is really useful!
I feel overwhelmed by all the available tools for testing, I wonder which one do you use the most from this list:
https://indrajeetpatil.github.io/awesome-r-pkgtools/#general
It feels like {patrick} and {exampletestr} might help me with the DRY principle for tests and documentation.
FWIW we (at the tidyverse team) write a lot of tests, and our experience shows that you can go pretty far just by using testthat.
This is not to say that the other, complementary tools are not useful, but rather that you don't really need to worry about them just yet. It is good to know about them, so if you find something cumbersome in testthat, or you need more specialized tests (comparing images, testing HTTP, etc.) then you can check them out again.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.