diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-02-21 10:36:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-21 10:36:13 -0500 |
commit | dd8a10948195f231a6a9eb652e3f208813904ad6 (patch) | |
tree | f9a4afeb67bbead882c29c2458a5f1f99e2e42db /cli/js/permissions_test.ts | |
parent | d9efb8c02a0036d755c35e8e9c88d58bd45a9e2b (diff) |
refactor: remove unneeded ErrorKinds (#3936)
Diffstat (limited to 'cli/js/permissions_test.ts')
-rw-r--r-- | cli/js/permissions_test.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cli/js/permissions_test.ts b/cli/js/permissions_test.ts index d63dddb15..6d79cfec0 100644 --- a/cli/js/permissions_test.ts +++ b/cli/js/permissions_test.ts @@ -31,18 +31,26 @@ for (const grant of knownPermissions) { } test(async function permissionInvalidName(): Promise<void> { + let thrown = false; try { // eslint-disable-next-line @typescript-eslint/no-explicit-any await Deno.permissions.query({ name: "foo" as any }); } catch (e) { - assert(e.name === "Other"); + thrown = true; + assert(e instanceof Error); + } finally { + assert(thrown); } }); test(async function permissionNetInvalidUrl(): Promise<void> { + let thrown = false; try { await Deno.permissions.query({ name: "net", url: ":" }); } catch (e) { - assert(e.name === "UrlParse"); + thrown = true; + assert(e instanceof URIError); + } finally { + assert(thrown); } }); |