new refactor assertions documentation for clarity#353
Open
Kah2412 wants to merge 4 commits intoaskimed:mainfrom
Open
new refactor assertions documentation for clarity#353Kah2412 wants to merge 4 commits intoaskimed:mainfrom
Kah2412 wants to merge 4 commits intoaskimed:mainfrom
Conversation
Updated formatting and structure of the assertions documentation for clarity and consistency. Added sections for JSON, YAML, and GZip file comparisons.
nvnieuwk
reviewed
Mar 17, 2026
Collaborator
nvnieuwk
left a comment
There was a problem hiding this comment.
Hi could you please add some of the layout back to the document? I saw you removed all the headers and code blocks from the file 😁
Updated the documentation for file assertions in nf-test, improving clarity and consistency across sections.
Collaborator
|
I don't think this will work on the website. The website is built using mkdocs please take a look at the website to see what syntax is supported and which syntax isn't |
Updated documentation for file assertions in nf-test, including md5, JSON, YAML, GZip, and line filtering features.
Updated examples and formatting for JSON and YAML assertions in the documentation.
nvnieuwk
reviewed
Apr 14, 2026
Comment on lines
+11
to
+13
| ```groovy | ||
| assert path(process.out.out_ch.get(0)).md5 == "64debea5017a035ddc67c0b51fa84b16" | ||
| ``` | ||
| Note that for gzip compressed files, the `md5` property is calculated after gunzipping the file contents, whereas for other filetypes the `md5` property is directly | ||
| calculated on the file itself. | ||
|
|
||
| ## JSON Files | ||
| nf-test supports comparison of JSON files and keys within JSON files. | ||
| To assert that two JSON files contain the same keys and values: | ||
| ```Groovy | ||
| assert path(process.out.out_ch.get(0)).json == path('./some.json').json | ||
| ``` | ||
| Individual keys can also be asserted: | ||
|
|
||
| ```Groovy | ||
| assert path(process.out.out_ch.get(0)).json.key == "value" | ||
| ``` | ||
|
|
||
| ## YAML Files | ||
| nf-test supports comparison of YAML files and keys within YAML files. | ||
|
|
Collaborator
There was a problem hiding this comment.
This codeblock isn't closed. You can check your changes locally by running mkdocs serve if you installed mkdocs :)
nvnieuwk
reviewed
Apr 14, 2026
|
|
||
| To assert that two JSON files are identical: | ||
|
|
||
| assert path(process.out.out_ch.get(0)).json == path('./expected_output.json').json |
Collaborator
There was a problem hiding this comment.
This should be a codeblock
nvnieuwk
reviewed
Apr 14, 2026
Comment on lines
+27
to
+31
| { "tool": "nf-test", "version": "1.0" } | ||
| // Use dot notation to access the value of a specific field by name | ||
| assert path(process.out.out_ch.get(0)).json.tool == "nf-test" | ||
| assert path(process.out.out_ch.get(0)).json.version == "1.0" | ||
| YAML Files |
Collaborator
There was a problem hiding this comment.
Where is this coming from? 😅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'll update the Canvas document to include this formal explanation at the beginning, which helps contextualize the review.
I've added the "Rationale for Documentation Updates" section to the top of the Canvas document. You can copy the text from that section and paste it directly into the GitHub comment for the reviewer!