mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix: Deno.remove() to properly remove dangling symlinks (#3860)
For some reason, the unit tests for Deno.remove() were not being imported to unit_tests.ts and, consequently, not being executed. Thus, I imported them, refactored some existent ones and wrote new ones for the symlink removal case. Since the creation of a symlink is not implemented for Windows yet, assertions that consider this state were added when the tests are executed in this OS.
This commit is contained in:
parent
f168597b7a
commit
55063dd8e8
6 changed files with 277 additions and 126 deletions
|
@ -6,7 +6,7 @@ export interface RemoveOption {
|
|||
recursive?: boolean;
|
||||
}
|
||||
|
||||
/** Removes the named file or directory synchronously. Would throw
|
||||
/** Removes the named file, directory or symlink synchronously. Would throw
|
||||
* error if permission denied, not found, or directory not empty if `recursive`
|
||||
* set to false.
|
||||
* `recursive` is set to false by default.
|
||||
|
@ -17,7 +17,7 @@ export function removeSync(path: string, options: RemoveOption = {}): void {
|
|||
sendSync(dispatch.OP_REMOVE, { path, recursive: !!options.recursive });
|
||||
}
|
||||
|
||||
/** Removes the named file or directory. Would throw error if
|
||||
/** Removes the named file, directory or symlink. Would throw error if
|
||||
* permission denied, not found, or directory not empty if `recursive` set
|
||||
* to false.
|
||||
* `recursive` is set to false by default.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue