Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make interactive snapshot output a bit more obvious #2000

Merged
merged 7 commits into from
Nov 4, 2024

Conversation

hadley
Copy link
Member

@hadley hadley commented Oct 29, 2024

Testing this change revealed a bug in test_code(): specifying the default reporter happened after local_test_context() meaning that it failed to capture the actual user settings. I fixed this by now requiring a reporter (rather than a backup reporter).

Fixes #1992

@DavisVaughan I can't figure out how to test this, so you might want to run a few snapshot tests interactively (both inside of test_that() and directly).

Testing this change revealed a bug in `test_code()`: specifying the default reporter happened _after_ `local_test_context()` meaning that it failed to capture the actual user settings. I fixed this by now requiring a reporter (rather than a backup reporter).

Fixes #1992
@hadley
Copy link
Member Author

hadley commented Oct 29, 2024

As well as the test failure, I also need to add a news bullet.

Copy link
Member

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried running both test_that() blocks and expect_snapshot() calls directly and all looks good

R/snapshot.R Outdated Show resolved Hide resolved
@DavisVaughan
Copy link
Member

I think this looks nice now, not sure about your test failure though

Screenshot 2024-11-01 at 10 44 57 AM

@hadley
Copy link
Member Author

hadley commented Nov 4, 2024

@DavisVaughan can you take one more look please?

@hadley hadley merged commit 8d6f3d5 into main Nov 4, 2024
13 checks passed
@hadley hadley deleted the interactive-snapshot branch November 4, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make snapshot more obvious outside of tests
2 participants