Skip to content

Commit

Permalink
Replace manual assertions with snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
AmstlerStephan committed Dec 15, 2023
1 parent fcc40c6 commit b29eb84
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
17 changes: 1 addition & 16 deletions tests/modules/local/filter_results.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,7 @@ nextflow_process {

then {
assert process.success

with(process.out) {
with(results_filtered){

assert (size() == 2)

// access second element of first tuple
def lines = path(get(0).get(1)).readLinesGzip()

//check if regenie header is as expected
assert lines.get(0).equals("CHROM\tGENPOS\tID\tALLELE0\tALLELE1\tA1FREQ\tINFO\tN\tTEST\tBETA\tSE\tCHISQ\tLOG10P\tEXTRA")

//check amount of lines
assert (lines.size() == 117)
}
}
assert snapshot(process.out).match()
}

}
Expand Down
29 changes: 29 additions & 0 deletions tests/modules/local/filter_results.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"Should output only 117 filtered lines": {
"content": [
{
"0": [
[
"Y1",
"Y1.regenie.filtered.gz:md5,973ef7138c333f4c2d2787fad6c83f50"
],
[
"Y2",
"Y2.regenie.filtered.gz:md5,d471f295b41ae96c0b094faa464c549b"
]
],
"results_filtered": [
[
"Y1",
"Y1.regenie.filtered.gz:md5,973ef7138c333f4c2d2787fad6c83f50"
],
[
"Y2",
"Y2.regenie.filtered.gz:md5,d471f295b41ae96c0b094faa464c549b"
]
]
}
],
"timestamp": "2023-12-15T10:16:52.606586"
}
}

0 comments on commit b29eb84

Please sign in to comment.