Skip to content

Commit

Permalink
Merge pull request #2586 from mashehu/add-stubs-test-template
Browse files Browse the repository at this point in the history
add stub test to modules template
  • Loading branch information
mashehu authored Dec 19, 2023
2 parents d65d9cf + 5774a5a commit 2622557
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions nf_core/module-template/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,38 @@ nextflow_process {
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
//TODO nf-core: Add all required assertions to verify the test output.
// See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples.
)
}

}

// TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix.
test("sarscov2 - bam - stub") {

options "-stub"

when {
process {
"""
// TODO nf-core: define inputs of the process here. Example:
{% if has_meta %}
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true)
]
{%- else %}
input = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true)
{%- endif %}
"""
}
}

then {
assertAll(
{ assert process.success },
Expand Down
2 changes: 1 addition & 1 deletion nf_core/subworkflow-template/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// nf-core subworkflows test {{ component_name }}
nextflow_workflow {

name "Test Workflow {{ component_name_underscore|upper }}"
name "Test Subworkflow {{ component_name_underscore|upper }}"
script "../main.nf"
workflow "{{ component_name_underscore|upper }}"

Expand Down

0 comments on commit 2622557

Please sign in to comment.