Skip to content

Commit

Permalink
exchange manual assertions with snapshot
Browse files Browse the repository at this point in the history
    for "Should output all regenie lines"
  • Loading branch information
AmstlerStephan committed Dec 15, 2023
1 parent b29eb84 commit 0d5b012
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 18 deletions.
20 changes: 2 additions & 18 deletions tests/modules/local/filter_results.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,9 @@ nextflow_process {

then {
assert process.success

with(process.out) {

with(results_filtered){

assert (size() == 2)

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")

//all lines included since filter value is 0
assert (lines.size() == 1001)
}

}
}
assert snapshot(process.out).match()

}

}
}
27 changes: 27 additions & 0 deletions tests/modules/local/filter_results.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
{
"Should output all regenie lines": {
"content": [
{
"0": [
[
"Y1",
"Y1.regenie.filtered.gz:md5,d637f770b60b67e3fe3a5454dadc143b"
],
[
"Y2",
"Y2.regenie.filtered.gz:md5,6febee3426eaca4ca8b72540ba75e633"
]
],
"results_filtered": [
[
"Y1",
"Y1.regenie.filtered.gz:md5,d637f770b60b67e3fe3a5454dadc143b"
],
[
"Y2",
"Y2.regenie.filtered.gz:md5,6febee3426eaca4ca8b72540ba75e633"
]
]
}
],
"timestamp": "2023-12-15T10:30:54.852916"
},
"Should output only 117 filtered lines": {
"content": [
{
Expand Down

0 comments on commit 0d5b012

Please sign in to comment.