Skip to content

Commit

Permalink
add expected error class and messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Aug 21, 2024
1 parent 8281fb0 commit 11813f9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions path/dirname_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ Deno.test("posix.dirname() works with file URLs", () => {
);

// throws with non-file URLs
assertThrows(() => posix.dirname(new URL("https://deno.land/")));
assertThrows(
() => posix.dirname(new URL("https://deno.land/")),
TypeError,
"Must be a file URL.",
);
});

Deno.test("windows.dirname()", function () {
Expand All @@ -119,5 +123,9 @@ Deno.test("windows.dirname() works with file URLs", () => {
);

// throws with non-file URLs
assertThrows(() => windows.dirname(new URL("https://deno.land/")));
assertThrows(
() => windows.dirname(new URL("https://deno.land/")),
TypeError,
"Must be a file URL.",
);
});

0 comments on commit 11813f9

Please sign in to comment.