Skip to content

Commit

Permalink
throw exception if a test fails to trigger CI fail
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaranville committed Dec 5, 2023
1 parent 34f69c6 commit 5ab8237
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ add_tests(create_compressed);
add_tests(dimension_labels);
add_tests(dimension_scales);

let passed = true;
async function run_test(test) {
try {
await test.test();
Expand All @@ -42,6 +43,7 @@ async function run_test(test) {
catch (error) {
console.log('x', test.description);
console.log(error.stack);
passed = false;
}
}

Expand All @@ -52,3 +54,6 @@ async function run_tests(tests) {
}

await run_tests(tests);
if (!passed) {
throw new Error("Tests did not complete successfuly");
}

0 comments on commit 5ab8237

Please sign in to comment.