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/read_file_test.ts | |
parent | d9efb8c02a0036d755c35e8e9c88d58bd45a9e2b (diff) |
refactor: remove unneeded ErrorKinds (#3936)
Diffstat (limited to 'cli/js/read_file_test.ts')
-rw-r--r-- | cli/js/read_file_test.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cli/js/read_file_test.ts b/cli/js/read_file_test.ts index d40ea1b7b..726f08413 100644 --- a/cli/js/read_file_test.ts +++ b/cli/js/read_file_test.ts @@ -16,8 +16,7 @@ testPerm({ read: false }, function readFileSyncPerm(): void { Deno.readFileSync("cli/tests/fixture.json"); } catch (e) { caughtError = true; - assertEquals(e.kind, Deno.ErrorKind.PermissionDenied); - assertEquals(e.name, "PermissionDenied"); + assert(e instanceof Deno.Err.PermissionDenied); } assert(caughtError); }); @@ -29,7 +28,7 @@ testPerm({ read: true }, function readFileSyncNotFound(): void { data = Deno.readFileSync("bad_filename"); } catch (e) { caughtError = true; - assertEquals(e.kind, Deno.ErrorKind.NotFound); + assert(e instanceof Deno.Err.NotFound); } assert(caughtError); assert(data === undefined); @@ -50,8 +49,7 @@ testPerm({ read: false }, async function readFilePerm(): Promise<void> { await Deno.readFile("cli/tests/fixture.json"); } catch (e) { caughtError = true; - assertEquals(e.kind, Deno.ErrorKind.PermissionDenied); - assertEquals(e.name, "PermissionDenied"); + assert(e instanceof Deno.Err.PermissionDenied); } assert(caughtError); }); |