summaryrefslogtreecommitdiff
path: root/js/read_dir_test.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-03-06 20:48:46 -0500
committerGitHub <noreply@github.com>2019-03-06 20:48:46 -0500
commitc42a9d737081fb8ee768c7178dae0e1f19c0f343 (patch)
tree9ffb7e502da62793ea099c34bd7b29c8a7a19b19 /js/read_dir_test.ts
parentde1a10e5f7afe793a66b2349642ea135fc066104 (diff)
Upgrade deno_std (#1892)
A major API change was that asserts are imported from testing/asserts.ts now rather than testing/mod.ts and assertEqual as renamed to assertEquals to conform to what is most common in JavaScript.
Diffstat (limited to 'js/read_dir_test.ts')
-rw-r--r--js/read_dir_test.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/js/read_dir_test.ts b/js/read_dir_test.ts
index 54cc468b7..914c2b2a8 100644
--- a/js/read_dir_test.ts
+++ b/js/read_dir_test.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { testPerm, assert, assertEqual } from "./test_util.ts";
+import { testPerm, assert, assertEquals } from "./test_util.ts";
type FileInfo = Deno.FileInfo;
@@ -13,13 +13,13 @@ function assertSameContent(files: FileInfo[]) {
}
if (file.name === "002_hello.ts") {
- assertEqual(file.path, `tests/${file.name}`);
- assertEqual(file.mode!, Deno.statSync(`tests/${file.name}`).mode!);
+ assertEquals(file.path, `tests/${file.name}`);
+ assertEquals(file.mode!, Deno.statSync(`tests/${file.name}`).mode!);
counter++;
}
}
- assertEqual(counter, 2);
+ assertEquals(counter, 2);
}
testPerm({ read: true }, function readDirSyncSuccess() {
@@ -33,8 +33,8 @@ testPerm({ read: false }, function readDirSyncPerm() {
const files = Deno.readDirSync("tests/");
} catch (e) {
caughtError = true;
- assertEqual(e.kind, Deno.ErrorKind.PermissionDenied);
- assertEqual(e.name, "PermissionDenied");
+ assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
+ assertEquals(e.name, "PermissionDenied");
}
assert(caughtError);
});
@@ -47,10 +47,10 @@ testPerm({ read: true }, function readDirSyncNotDir() {
src = Deno.readDirSync("package.json");
} catch (err) {
caughtError = true;
- assertEqual(err.kind, Deno.ErrorKind.Other);
+ assertEquals(err.kind, Deno.ErrorKind.Other);
}
assert(caughtError);
- assertEqual(src, undefined);
+ assertEquals(src, undefined);
});
testPerm({ read: true }, function readDirSyncNotFound() {
@@ -61,10 +61,10 @@ testPerm({ read: true }, function readDirSyncNotFound() {
src = Deno.readDirSync("bad_dir_name");
} catch (err) {
caughtError = true;
- assertEqual(err.kind, Deno.ErrorKind.NotFound);
+ assertEquals(err.kind, Deno.ErrorKind.NotFound);
}
assert(caughtError);
- assertEqual(src, undefined);
+ assertEquals(src, undefined);
});
testPerm({ read: true }, async function readDirSuccess() {
@@ -78,8 +78,8 @@ testPerm({ read: false }, async function readDirPerm() {
const files = await Deno.readDir("tests/");
} catch (e) {
caughtError = true;
- assertEqual(e.kind, Deno.ErrorKind.PermissionDenied);
- assertEqual(e.name, "PermissionDenied");
+ assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
+ assertEquals(e.name, "PermissionDenied");
}
assert(caughtError);
});