summaryrefslogtreecommitdiff
path: root/js/os_test.ts
diff options
context:
space:
mode:
authorSajjad Hashemian <wolaws@gmail.com>2018-09-12 00:08:53 +0430
committerRyan Dahl <ry@tinyclouds.org>2018-09-11 16:05:00 -0400
commit7c50c11f40556240a3693662e2cbae6da3090b89 (patch)
tree4b0d69d9c5c029fe0c4000f526e5370edbb0ab72 /js/os_test.ts
parent806385543c8367b9acca4d3dcb24945cc4de2ef2 (diff)
Implement deno.stat() and deno.lstat()
Diffstat (limited to 'js/os_test.ts')
-rw-r--r--js/os_test.ts62
1 files changed, 0 insertions, 62 deletions
diff --git a/js/os_test.ts b/js/os_test.ts
index 4c5da1505..c0198095c 100644
--- a/js/os_test.ts
+++ b/js/os_test.ts
@@ -23,68 +23,6 @@ test(async function envFailure() {
assert(caughtError);
});
-// TODO Add tests for modified, accessed, and created fields once there is a way
-// to create temp files.
-test(async function statSyncSuccess() {
- const packageInfo = deno.statSync("package.json");
- assert(packageInfo.isFile());
- assert(!packageInfo.isSymlink());
-
- const testingInfo = deno.statSync("testing");
- assert(testingInfo.isDirectory());
- assert(!testingInfo.isSymlink());
-
- const srcInfo = deno.statSync("src");
- assert(srcInfo.isDirectory());
- assert(!srcInfo.isSymlink());
-});
-
-test(async function statSyncNotFound() {
- let caughtError = false;
- let badInfo;
-
- try {
- badInfo = deno.statSync("bad_file_name");
- } catch (err) {
- caughtError = true;
- assertEqual(err.kind, deno.ErrorKind.NotFound);
- assertEqual(err.name, "NotFound");
- }
-
- assert(caughtError);
- assertEqual(badInfo, undefined);
-});
-
-test(async function lstatSyncSuccess() {
- const packageInfo = deno.lstatSync("package.json");
- assert(packageInfo.isFile());
- assert(!packageInfo.isSymlink());
-
- const testingInfo = deno.lstatSync("testing");
- assert(!testingInfo.isDirectory());
- assert(testingInfo.isSymlink());
-
- const srcInfo = deno.lstatSync("src");
- assert(srcInfo.isDirectory());
- assert(!srcInfo.isSymlink());
-});
-
-test(async function lstatSyncNotFound() {
- let caughtError = false;
- let badInfo;
-
- try {
- badInfo = deno.lstatSync("bad_file_name");
- } catch (err) {
- caughtError = true;
- assertEqual(err.kind, deno.ErrorKind.NotFound);
- assertEqual(err.name, "NotFound");
- }
-
- assert(caughtError);
- assertEqual(badInfo, undefined);
-});
-
testPerm({ write: true }, function makeTempDirSync() {
const dir1 = deno.makeTempDirSync({ prefix: "hello", suffix: "world" });
const dir2 = deno.makeTempDirSync({ prefix: "hello", suffix: "world" });