mirror of
https://github.com/denoland/deno.git
synced 2025-10-01 14:41:15 +00:00
fs utils getFileInfoType() return undefined when not found (denoland/deno_std#341)
Original: 0a61800163
This commit is contained in:
parent
bbdd51574c
commit
0fb83ba0d2
3 changed files with 20 additions and 20 deletions
|
@ -36,21 +36,21 @@ test(function _isSubdir() {
|
|||
|
||||
test(function _getFileInfoType() {
|
||||
const pairs = [
|
||||
[path.join(testdataDir, "file_type_1"), PathType.file],
|
||||
[path.join(testdataDir, "file_type_dir_1"), PathType.dir]
|
||||
[path.join(testdataDir, "file_type_1"), "file"],
|
||||
[path.join(testdataDir, "file_type_dir_1"), "dir"]
|
||||
];
|
||||
|
||||
pairs.forEach(function(p) {
|
||||
const filePath = p[0] as string;
|
||||
const type = p[1] as PathType;
|
||||
switch (type) {
|
||||
case PathType.file:
|
||||
case "file":
|
||||
ensureFileSync(filePath);
|
||||
break;
|
||||
case PathType.dir:
|
||||
case "dir":
|
||||
ensureDirSync(filePath);
|
||||
break;
|
||||
case PathType.symlink:
|
||||
case "symlink":
|
||||
// TODO(axetroy): test symlink
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue