summaryrefslogtreecommitdiff
path: root/cli/js/utime_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/utime_test.ts')
-rw-r--r--cli/js/utime_test.ts14
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);
});