diff --git a/deno.jsonc b/deno.jsonc index 0d0c849..3fd2323 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -32,7 +32,7 @@ }, "tasks": { "test": "deno fmt --check && deno lint && deno test --allow-read --allow-net --allow-write --allow-run src", - "coverage": "deno test --allow-read --allow-net --allow-write --allow-run --coverage=.coverage src && deno coverage --exclude=fixtures --exclude=test --lcov --output=lcov.info .coverage && deno run --allow-read https://deno.land/x/code_coverage@0.2.0/cli.ts" + "coverage": "rm -rf .coverage && deno test --reporter=dot --allow-read --allow-net --allow-write --allow-run --coverage=.coverage src && deno coverage --exclude=fixtures --exclude=test --lcov --output=lcov.info .coverage && deno run --allow-read https://deno.land/x/code_coverage@0.2.0/cli.ts" }, "lock": false } diff --git a/src/tests/get_trigger_test.ts b/src/tests/get_trigger_test.ts index 593aa3f..a8a1c2f 100644 --- a/src/tests/get_trigger_test.ts +++ b/src/tests/get_trigger_test.ts @@ -3,17 +3,17 @@ import { assertRejects, assertStringIncludes } from "../dev_deps.ts"; Deno.test("get-trigger hook", async (t) => { await t.step("getTrigger function", async (tt) => { - await tt.step("should throw if no source CLI flag provided", () => { - assertRejects( - () => getTrigger([]), + await tt.step("should throw if no source CLI flag provided", async () => { + await assertRejects( + async () => await getTrigger([]), Error, "source path needs to be defined", ); }); - await tt.step("should throw if provided source is not a file", () => { - assertRejects( - () => getTrigger(["--source", "src"]), + await tt.step("should throw if provided source is not a file", async () => { + await assertRejects( + async () => await getTrigger(["--source", "src"]), Error, "source is not a valid file", ); @@ -35,24 +35,27 @@ Deno.test("get-trigger hook", async (t) => { assertStringIncludes(json.name, "greeting"); }); - await tt.step("should throw if provided .ts has no default export", () => { - assertRejects( - () => - getTrigger([ - "--source", - "src/tests/fixtures/triggers/no_default_export_trigger.ts", - ]), - Error, - "no default export", - ); - }); + await tt.step( + "should throw if provided .ts has no default export", + async () => { + await assertRejects( + async () => + await getTrigger([ + "--source", + "src/tests/fixtures/triggers/no_default_export_trigger.ts", + ]), + Error, + "no default export", + ); + }, + ); await tt.step( "should throw if provided .ts has a non-object default export", - () => { - assertRejects( - () => - getTrigger([ + async () => { + await assertRejects( + async () => + await getTrigger([ "--source", "src/tests/fixtures/triggers/non_object_trigger.ts", ]),