diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2021-08-11 10:20:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-11 10:20:47 -0400 |
| commit | 15a763152f9d392cb80692262f8de5ef8ae15495 (patch) | |
| tree | fcd1a59777f95920bf3502519983d6cc0d882a9a /cli/tests/unit/read_text_file_test.ts | |
| parent | a0285e2eb88f6254f6494b0ecd1878db3a3b2a58 (diff) | |
chore: move test files to testdata directory (#11601)
Diffstat (limited to 'cli/tests/unit/read_text_file_test.ts')
| -rw-r--r-- | cli/tests/unit/read_text_file_test.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/tests/unit/read_text_file_test.ts b/cli/tests/unit/read_text_file_test.ts index a7eb1a730..3d7ccfaa6 100644 --- a/cli/tests/unit/read_text_file_test.ts +++ b/cli/tests/unit/read_text_file_test.ts @@ -8,7 +8,7 @@ import { } from "./test_util.ts"; unitTest({ perms: { read: true } }, function readTextFileSyncSuccess() { - const data = Deno.readTextFileSync("cli/tests/fixture.json"); + const data = Deno.readTextFileSync("cli/tests/testdata/fixture.json"); assert(data.length > 0); const pkg = JSON.parse(data); assertEquals(pkg.name, "deno"); @@ -16,7 +16,7 @@ unitTest({ perms: { read: true } }, function readTextFileSyncSuccess() { unitTest({ perms: { read: true } }, function readTextFileSyncByUrl() { const data = Deno.readTextFileSync( - pathToAbsoluteFileUrl("cli/tests/fixture.json"), + pathToAbsoluteFileUrl("cli/tests/testdata/fixture.json"), ); assert(data.length > 0); const pkg = JSON.parse(data); @@ -25,7 +25,7 @@ unitTest({ perms: { read: true } }, function readTextFileSyncByUrl() { unitTest({ perms: { read: false } }, function readTextFileSyncPerm() { assertThrows(() => { - Deno.readTextFileSync("cli/tests/fixture.json"); + Deno.readTextFileSync("cli/tests/testdata/fixture.json"); }, Deno.errors.PermissionDenied); }); @@ -38,7 +38,7 @@ unitTest({ perms: { read: true } }, function readTextFileSyncNotFound() { unitTest( { perms: { read: true } }, async function readTextFileSuccess() { - const data = await Deno.readTextFile("cli/tests/fixture.json"); + const data = await Deno.readTextFile("cli/tests/testdata/fixture.json"); assert(data.length > 0); const pkg = JSON.parse(data); assertEquals(pkg.name, "deno"); @@ -47,7 +47,7 @@ unitTest( unitTest({ perms: { read: true } }, async function readTextFileByUrl() { const data = await Deno.readTextFile( - pathToAbsoluteFileUrl("cli/tests/fixture.json"), + pathToAbsoluteFileUrl("cli/tests/testdata/fixture.json"), ); assert(data.length > 0); const pkg = JSON.parse(data); @@ -56,13 +56,13 @@ unitTest({ perms: { read: true } }, async function readTextFileByUrl() { unitTest({ perms: { read: false } }, async function readTextFilePerm() { await assertThrowsAsync(async () => { - await Deno.readTextFile("cli/tests/fixture.json"); + await Deno.readTextFile("cli/tests/testdata/fixture.json"); }, Deno.errors.PermissionDenied); }); unitTest({ perms: { read: true } }, function readTextFileSyncLoop() { for (let i = 0; i < 256; i++) { - Deno.readTextFileSync("cli/tests/fixture.json"); + Deno.readTextFileSync("cli/tests/testdata/fixture.json"); } }); |
