summaryrefslogtreecommitdiff
path: root/std/node/_fs/_fs_dirent_test.ts
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-02-02 19:05:46 +0800
committerGitHub <noreply@github.com>2021-02-02 12:05:46 +0100
commit6abf126c2a7a451cded8c6b5e6ddf1b69c84055d (patch)
treefd94c013a19fcb38954844085821ec1601c20e18 /std/node/_fs/_fs_dirent_test.ts
parenta2b5d44f1aa9d64f448a2a3cc2001272e2f60b98 (diff)
chore: remove std directory (#9361)
This removes the std folder from the tree. Various parts of the tests are pretty tightly dependent on std (47 direct imports and 75 indirect imports, not counting the cli tests that use them as fixtures) so I've added std as a submodule for now.
Diffstat (limited to 'std/node/_fs/_fs_dirent_test.ts')
-rw-r--r--std/node/_fs/_fs_dirent_test.ts79
1 files changed, 0 insertions, 79 deletions
diff --git a/std/node/_fs/_fs_dirent_test.ts b/std/node/_fs/_fs_dirent_test.ts
deleted file mode 100644
index ad599c84c..000000000
--- a/std/node/_fs/_fs_dirent_test.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-import { assert, assertEquals, assertThrows } from "../../testing/asserts.ts";
-import Dirent from "./_fs_dirent.ts";
-
-class DirEntryMock implements Deno.DirEntry {
- name = "";
- isFile = false;
- isDirectory = false;
- isSymlink = false;
-}
-
-Deno.test({
- name: "Directories are correctly identified",
- fn() {
- const entry: DirEntryMock = new DirEntryMock();
- entry.isDirectory = true;
- entry.isFile = false;
- entry.isSymlink = false;
- assert(new Dirent(entry).isDirectory());
- assert(!new Dirent(entry).isFile());
- assert(!new Dirent(entry).isSymbolicLink());
- },
-});
-
-Deno.test({
- name: "Files are correctly identified",
- fn() {
- const entry: DirEntryMock = new DirEntryMock();
- entry.isDirectory = false;
- entry.isFile = true;
- entry.isSymlink = false;
- assert(!new Dirent(entry).isDirectory());
- assert(new Dirent(entry).isFile());
- assert(!new Dirent(entry).isSymbolicLink());
- },
-});
-
-Deno.test({
- name: "Symlinks are correctly identified",
- fn() {
- const entry: DirEntryMock = new DirEntryMock();
- entry.isDirectory = false;
- entry.isFile = false;
- entry.isSymlink = true;
- assert(!new Dirent(entry).isDirectory());
- assert(!new Dirent(entry).isFile());
- assert(new Dirent(entry).isSymbolicLink());
- },
-});
-
-Deno.test({
- name: "File name is correct",
- fn() {
- const entry: DirEntryMock = new DirEntryMock();
- entry.name = "my_file";
- assertEquals(new Dirent(entry).name, "my_file");
- },
-});
-
-Deno.test({
- name: "Socket and FIFO pipes aren't yet available",
- fn() {
- const entry: DirEntryMock = new DirEntryMock();
- assertThrows(
- () => {
- new Dirent(entry).isFIFO();
- },
- Error,
- "does not yet support",
- );
- assertThrows(
- () => {
- new Dirent(entry).isSocket();
- },
- Error,
- "does not yet support",
- );
- },
-});