Closed bersbersbers closed 3 years ago
Thank you for the great reprex!
When using a custom name, please add a .json
to the end of your filename. Ex:
app$snapshot(filename = "test.json")
The logic to handle the file comparisons is done here: https://github.com/rstudio/shinytest/blob/9eb82c7e0b51d5d3d4a377678b72d86bb7c33817/R/view-diff.R#L43-L51
If not .json
, .download
or .png
, then no file content is returned. Not ideal, but helps deter comparing a PDF files and binary files.
I'll add a check in a PR to the filename argument to make sure it is json or provide a hash for non-text files.
On the shell:
In R:
In shell:
TLDR: Text files are significantly different (not just line endings).
testApp()
reports them as different.viewTestDiff()
does not.