summaryrefslogtreecommitdiff
path: root/cli/js/stat_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/stat_test.ts')
-rw-r--r--cli/js/stat_test.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/cli/js/stat_test.ts b/cli/js/stat_test.ts
index 6c42b277c..38bd3f6c6 100644
--- a/cli/js/stat_test.ts
+++ b/cli/js/stat_test.ts
@@ -4,11 +4,11 @@ import { testPerm, assert, assertEquals } from "./test_util.ts";
// TODO Add tests for modified, accessed, and created fields once there is a way
// to create temp files.
testPerm({ read: true }, async function statSyncSuccess(): Promise<void> {
- const packageInfo = Deno.statSync("package.json");
+ const packageInfo = Deno.statSync("README.md");
assert(packageInfo.isFile());
assert(!packageInfo.isSymlink());
- const modulesInfo = Deno.statSync("node_modules");
+ const modulesInfo = Deno.statSync("cli/tests/symlink_to_subdir");
assert(modulesInfo.isDirectory());
assert(!modulesInfo.isSymlink());
@@ -20,7 +20,7 @@ testPerm({ read: true }, async function statSyncSuccess(): Promise<void> {
testPerm({ read: false }, async function statSyncPerm(): Promise<void> {
let caughtError = false;
try {
- Deno.statSync("package.json");
+ Deno.statSync("README.md");
} catch (e) {
caughtError = true;
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
@@ -46,11 +46,11 @@ testPerm({ read: true }, async function statSyncNotFound(): Promise<void> {
});
testPerm({ read: true }, async function lstatSyncSuccess(): Promise<void> {
- const packageInfo = Deno.lstatSync("package.json");
+ const packageInfo = Deno.lstatSync("README.md");
assert(packageInfo.isFile());
assert(!packageInfo.isSymlink());
- const modulesInfo = Deno.lstatSync("node_modules");
+ const modulesInfo = Deno.lstatSync("cli/tests/symlink_to_subdir");
assert(!modulesInfo.isDirectory());
assert(modulesInfo.isSymlink());
@@ -62,7 +62,7 @@ testPerm({ read: true }, async function lstatSyncSuccess(): Promise<void> {
testPerm({ read: false }, async function lstatSyncPerm(): Promise<void> {
let caughtError = false;
try {
- Deno.lstatSync("package.json");
+ Deno.lstatSync("README.md");
} catch (e) {
caughtError = true;
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
@@ -88,11 +88,11 @@ testPerm({ read: true }, async function lstatSyncNotFound(): Promise<void> {
});
testPerm({ read: true }, async function statSuccess(): Promise<void> {
- const packageInfo = await Deno.stat("package.json");
+ const packageInfo = await Deno.stat("README.md");
assert(packageInfo.isFile());
assert(!packageInfo.isSymlink());
- const modulesInfo = await Deno.stat("node_modules");
+ const modulesInfo = await Deno.stat("cli/tests/symlink_to_subdir");
assert(modulesInfo.isDirectory());
assert(!modulesInfo.isSymlink());
@@ -104,7 +104,7 @@ testPerm({ read: true }, async function statSuccess(): Promise<void> {
testPerm({ read: false }, async function statPerm(): Promise<void> {
let caughtError = false;
try {
- await Deno.stat("package.json");
+ await Deno.stat("README.md");
} catch (e) {
caughtError = true;
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
@@ -130,11 +130,11 @@ testPerm({ read: true }, async function statNotFound(): Promise<void> {
});
testPerm({ read: true }, async function lstatSuccess(): Promise<void> {
- const packageInfo = await Deno.lstat("package.json");
+ const packageInfo = await Deno.lstat("README.md");
assert(packageInfo.isFile());
assert(!packageInfo.isSymlink());
- const modulesInfo = await Deno.lstat("node_modules");
+ const modulesInfo = await Deno.lstat("cli/tests/symlink_to_subdir");
assert(!modulesInfo.isDirectory());
assert(modulesInfo.isSymlink());
@@ -146,7 +146,7 @@ testPerm({ read: true }, async function lstatSuccess(): Promise<void> {
testPerm({ read: false }, async function lstatPerm(): Promise<void> {
let caughtError = false;
try {
- await Deno.lstat("package.json");
+ await Deno.lstat("README.md");
} catch (e) {
caughtError = true;
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);