From dd8a10948195f231a6a9eb652e3f208813904ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 21 Feb 2020 10:36:13 -0500 Subject: refactor: remove unneeded ErrorKinds (#3936) --- cli/js/chmod_test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'cli/js/chmod_test.ts') diff --git a/cli/js/chmod_test.ts b/cli/js/chmod_test.ts index b3b0a2ae2..24c69db7a 100644 --- a/cli/js/chmod_test.ts +++ b/cli/js/chmod_test.ts @@ -60,8 +60,7 @@ testPerm({ write: true }, function chmodSyncFailure(): void { } catch (e) { err = e; } - assertEquals(err.kind, Deno.ErrorKind.NotFound); - assertEquals(err.name, "NotFound"); + assert(err instanceof Deno.Err.NotFound); }); testPerm({ write: false }, function chmodSyncPerm(): void { @@ -71,7 +70,7 @@ testPerm({ write: false }, function chmodSyncPerm(): void { } catch (e) { err = e; } - assertEquals(err.kind, Deno.ErrorKind.PermissionDenied); + assert(err instanceof Deno.Err.PermissionDenied); assertEquals(err.name, "PermissionDenied"); }); @@ -134,8 +133,7 @@ testPerm({ write: true }, async function chmodFailure(): Promise { } catch (e) { err = e; } - assertEquals(err.kind, Deno.ErrorKind.NotFound); - assertEquals(err.name, "NotFound"); + assert(err instanceof Deno.Err.NotFound); }); testPerm({ write: false }, async function chmodPerm(): Promise { @@ -145,6 +143,6 @@ testPerm({ write: false }, async function chmodPerm(): Promise { } catch (e) { err = e; } - assertEquals(err.kind, Deno.ErrorKind.PermissionDenied); + assert(err instanceof Deno.Err.PermissionDenied); assertEquals(err.name, "PermissionDenied"); }); -- cgit v1.2.3