At the moment the only reference to mockery is via the deprecation message of former mocking functions. Could there be a link to mockery maybe from the README?
Activity
hadley commentedon Dec 3, 2020
maelle commentedon Dec 3, 2020
hadley commentedon Dec 3, 2020
maelle commentedon Dec 3, 2020
https://blog.r-hub.io/2019/10/29/mocking/ was relatively popular (well for an R-hub post 🙂 ) so I think a vignette about such topics would be awesome.
[-]Add a prominent link to mockery?[/-][+]Vignetting on testing challenging functions[/+]nbenn commentedon Dec 10, 2020
krlmlr commentedon Dec 11, 2020
maelle commentedon Jan 12, 2021
Regarding plots, some guidance on testthat visual snapshots vs vdiffr (or how the two tools complement each other) would be nice.
[-]Vignetting on testing challenging functions[/-][+]Vignette on testing challenging functions[/+]hadley commentedon Jan 5, 2022
expect_snapshot()for length-y text outputtransformto eliminate spurious differenceshadley commentedon Sep 15, 2023
I made this list for a recent workshop on testing:
withr::local_seed()withr::local_options()/withr::local_envvar()Are there any other major classes of challenge that you can think of?
maelle commentedon Dec 19, 2023
Regarding interactivity (and other examples like "code that should be run if there is no internet connection"), maybe also mention escape hatches? https://blog.r-hub.io/2023/01/23/code-switch-escape-hatch-test/
hadley commentedon Dec 19, 2023
@maelle in that case (especially with
local_mocked_bindings()), mocking feels like a clear win.maelle commentedon Feb 19, 2025
hadley commentedon Feb 19, 2025
maelle commentedon Feb 20, 2025
hadley commentedon Feb 20, 2025
maelle commentedon Feb 21, 2025
maelle commentedon Feb 21, 2025
Vignettes on challenging tests (r-lib#2198)