Skip to content

snapshot that contains full contents of a file #252

Answered by lukfor
wholtz asked this question in Questions
Discussion options

You must be logged in to vote

When using snapshot assertions to compare the contents of files, the text property is used to directly access the textual content of the files. This allows you to compare the actual text within the files rather than just comparing their md5 sum.

Example:

assert snapshot(
    path("${params.outdir}/file1.txt").text, 
    path("${params.outdir}/file2.txt").text
).match()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wholtz
Comment options

Answer selected by wholtz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants