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/utime_test.ts | |
parent | d9efb8c02a0036d755c35e8e9c88d58bd45a9e2b (diff) |
refactor: remove unneeded ErrorKinds (#3936)
Diffstat (limited to 'cli/js/utime_test.ts')
-rw-r--r-- | cli/js/utime_test.ts | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/cli/js/utime_test.ts b/cli/js/utime_test.ts index 72a4a6477..c7e4293bf 100644 --- a/cli/js/utime_test.ts +++ b/cli/js/utime_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { testPerm, assert, assertEquals } from "./test_util.ts"; +import { testPerm, assert } from "./test_util.ts"; // Allow 10 second difference. // Note this might not be enough for FAT (but we are not testing on such fs). @@ -78,8 +78,7 @@ testPerm({ read: true, write: true }, function utimeSyncNotFound(): void { Deno.utimeSync("/baddir", atime, mtime); } catch (e) { caughtError = true; - assertEquals(e.kind, Deno.ErrorKind.NotFound); - assertEquals(e.name, "NotFound"); + assert(e instanceof Deno.Err.NotFound); } assert(caughtError); }); @@ -93,8 +92,7 @@ testPerm({ read: true, write: false }, function utimeSyncPerm(): void { Deno.utimeSync("/some_dir", atime, mtime); } catch (e) { caughtError = true; - assertEquals(e.kind, Deno.ErrorKind.PermissionDenied); - assertEquals(e.name, "PermissionDenied"); + assert(e instanceof Deno.Err.PermissionDenied); } assert(caughtError); }); @@ -159,8 +157,7 @@ testPerm({ read: true, write: true }, async function utimeNotFound(): Promise< await Deno.utime("/baddir", atime, mtime); } catch (e) { caughtError = true; - assertEquals(e.kind, Deno.ErrorKind.NotFound); - assertEquals(e.name, "NotFound"); + assert(e instanceof Deno.Err.NotFound); } assert(caughtError); }); @@ -176,8 +173,7 @@ testPerm({ read: true, write: false }, async function utimeSyncPerm(): Promise< await Deno.utime("/some_dir", atime, mtime); } catch (e) { caughtError = true; - assertEquals(e.kind, Deno.ErrorKind.PermissionDenied); - assertEquals(e.name, "PermissionDenied"); + assert(e instanceof Deno.Err.PermissionDenied); } assert(caughtError); }); |