Skip to content

Vignette on testing challenging functions #1265

Closed

Description

@maelle

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

  1. hadley commented on Dec 3, 2020

    @hadley
  2. maelle commented on Dec 3, 2020

    @maelle
    Author
  3. hadley commented on Dec 3, 2020

    @hadley
  4. maelle commented on Dec 3, 2020

    @maelle
    ContributorAuthor

    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.

  5. changed the title [-]Add a prominent link to mockery?[/-] [+]Vignetting on testing challenging functions[/+] on Dec 4, 2020
  6. nbenn commented on Dec 10, 2020

    @nbenn
  7. krlmlr commented on Dec 11, 2020

    @krlmlr
  8. maelle commented on Jan 12, 2021

    @maelle
    ContributorAuthor

    Regarding plots, some guidance on testthat visual snapshots vs vdiffr (or how the two tools complement each other) would be nice.

  9. changed the title [-]Vignetting on testing challenging functions[/-] [+]Vignette on testing challenging functions[/+] on Sep 13, 2021
  10. hadley commented on Jan 5, 2022

    @hadley
    Member
    • Use of expect_snapshot() for length-y text output
    • Plus use of mocking and/or transform to eliminate spurious differences
  11. hadley commented on Sep 15, 2023

    @hadley
    Member

    I made this list for a recent workshop on testing:

    Are there any other major classes of challenge that you can think of?

  12. maelle commented on Dec 19, 2023

    @maelle
    ContributorAuthor

    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/

  13. hadley commented on Dec 19, 2023

    @hadley
    Member

    @maelle in that case (especially with local_mocked_bindings()), mocking feels like a clear win.

  14. maelle commented on Feb 19, 2025

    @maelle
    Author
  15. hadley commented on Feb 19, 2025

    @hadley
  16. maelle commented on Feb 20, 2025

    @maelle
    Author
  17. hadley commented on Feb 20, 2025

    @hadley
  18. maelle commented on Feb 21, 2025

    @maelle
    Author
  19. maelle commented on Feb 21, 2025

    @maelle
    Author
  20. added a commit that references this issue on Sep 5, 2025
    387580b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions