I've deprecated several functions in my R package by including a .Deprecated("new_function_name")
line at the start of the function. I had full unit test coverage for those deprecated functions. Now those tests produce warnings (because of the deprecation message) and muddy up the results of testthat::test()
and devtools::check().
I could just delete the test coverage for deprecated functions, but it seems like as long as users can still call the functions, I should retain test coverage. Is there a way I can keep the tests but avoid the clutter in the result of check()
? E.g., tell testthat
to count them as passing if the expect_equal()
still works, ignoring the deprecation warnings?
test()
. I'd love to put this approach in a function so I could just change my tests fromexpect_equal
toexpect_equal_deprecated
- would be cleaner to implement vs. updating each test like this. But I tinkered with it and don't see a way, so maybe this is the best that can be done. – Koball