summaryrefslogtreecommitdiff
path: root/cli/js/tests/read_dir_test.ts
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2020-04-29 22:00:31 +0200
committerGitHub <noreply@github.com>2020-04-29 16:00:31 -0400
commit3e6ea6284178df0be4982d9775f47b47b14c6139 (patch)
treeed684ea536e32023e72004110556ad8285126676 /cli/js/tests/read_dir_test.ts
parent721a4ad59d4a8bdd8470d6b98839137f14c84ba9 (diff)
BREAKING: Include limited metadata in 'DirEntry' objects (#4941)
This change is to prevent needed a separate stat syscall for each file when using readdir. For consistency, this PR also modifies std's `WalkEntry` interface to extend `DirEntry` with an additional `path` field.
Diffstat (limited to 'cli/js/tests/read_dir_test.ts')
-rw-r--r--cli/js/tests/read_dir_test.ts13
1 files changed, 4 insertions, 9 deletions
diff --git a/cli/js/tests/read_dir_test.ts b/cli/js/tests/read_dir_test.ts
index 2c7f42103..f1c7ea121 100644
--- a/cli/js/tests/read_dir_test.ts
+++ b/cli/js/tests/read_dir_test.ts
@@ -4,19 +4,14 @@ import { unitTest, assert, assertEquals } from "./test_util.ts";
function assertSameContent(files: Deno.DirEntry[]): void {
let counter = 0;
- for (const file of files) {
- if (file.name === "subdir") {
- assert(file.isDirectory);
- counter++;
- }
-
- if (file.name === "002_hello.ts") {
- assertEquals(file.mode!, Deno.statSync(`cli/tests/${file.name}`).mode!);
+ for (const entry of files) {
+ if (entry.name === "subdir") {
+ assert(entry.isDirectory);
counter++;
}
}
- assertEquals(counter, 2);
+ assertEquals(counter, 1);
}
unitTest({ perms: { read: true } }, function readdirSyncSuccess(): void {