summaryrefslogtreecommitdiff
path: root/cli/tests/unit/read_dir_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/read_dir_test.ts')
-rw-r--r--cli/tests/unit/read_dir_test.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/cli/tests/unit/read_dir_test.ts b/cli/tests/unit/read_dir_test.ts
index 2e4370153..4f02fae9b 100644
--- a/cli/tests/unit/read_dir_test.ts
+++ b/cli/tests/unit/read_dir_test.ts
@@ -22,12 +22,14 @@ function assertSameContent(files: Deno.DirEntry[]) {
}
unitTest({ perms: { read: true } }, function readDirSyncSuccess() {
- const files = [...Deno.readDirSync("cli/tests/")];
+ const files = [...Deno.readDirSync("cli/tests/testdata")];
assertSameContent(files);
});
unitTest({ perms: { read: true } }, function readDirSyncWithUrl() {
- const files = [...Deno.readDirSync(pathToAbsoluteFileUrl("cli/tests"))];
+ const files = [
+ ...Deno.readDirSync(pathToAbsoluteFileUrl("cli/tests/testdata")),
+ ];
assertSameContent(files);
});
@@ -39,7 +41,7 @@ unitTest({ perms: { read: false } }, function readDirSyncPerm() {
unitTest({ perms: { read: true } }, function readDirSyncNotDir() {
assertThrows(() => {
- Deno.readDirSync("cli/tests/fixture.json");
+ Deno.readDirSync("cli/tests/testdata/fixture.json");
}, Error);
});
@@ -51,7 +53,7 @@ unitTest({ perms: { read: true } }, function readDirSyncNotFound() {
unitTest({ perms: { read: true } }, async function readDirSuccess() {
const files = [];
- for await (const dirEntry of Deno.readDir("cli/tests/")) {
+ for await (const dirEntry of Deno.readDir("cli/tests/testdata")) {
files.push(dirEntry);
}
assertSameContent(files);
@@ -60,7 +62,7 @@ unitTest({ perms: { read: true } }, async function readDirSuccess() {
unitTest({ perms: { read: true } }, async function readDirWithUrl() {
const files = [];
for await (
- const dirEntry of Deno.readDir(pathToAbsoluteFileUrl("cli/tests"))
+ const dirEntry of Deno.readDir(pathToAbsoluteFileUrl("cli/tests/testdata"))
) {
files.push(dirEntry);
}