mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
refactor: reduce number of ErrorKind variants (#3662)
This commit is contained in:
parent
e83658138b
commit
c90036ab88
13 changed files with 61 additions and 224 deletions
|
@ -35,15 +35,14 @@ test(async function permissionInvalidName(): Promise<void> {
|
|||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
await Deno.permissions.query({ name: "foo" as any });
|
||||
} catch (e) {
|
||||
assert(e.name === "TypeError");
|
||||
assert(e.name === "Other");
|
||||
}
|
||||
});
|
||||
|
||||
test(async function permissionNetInvalidUrl(): Promise<void> {
|
||||
try {
|
||||
// Invalid url causes TypeError.
|
||||
await Deno.permissions.query({ name: "net", url: ":" });
|
||||
} catch (e) {
|
||||
assert(e.name === "TypeError");
|
||||
assert(e.name === "UrlParse");
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue