Skip to content

Commit

Permalink
fixup! fs: remove permissive rmdir recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Mar 19, 2021
1 parent d45a98b commit 8e1e85e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions test/parallel/test-fs-rmdir-recursive-sync-warns-on-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const path = require('path');
tmpdir.refresh();

{
// Should warn when trying to delete a file
common.expectWarning(
'DeprecationWarning',
'In future versions of Node.js, fs.rmdir(path, { recursive: true }) ' +
Expand All @@ -19,6 +18,6 @@ tmpdir.refresh();
fs.writeFileSync(filePath, '');
assert.throws(
() => fs.rmdirSync(filePath, { recursive: true }),
{ code: 'ENOTDIR' }
{ code: common.isWindows ? 'ENOENT' : 'ENOTDIR' }
);
}
3 changes: 1 addition & 2 deletions test/parallel/test-fs-rmdir-recursive-warns-on-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const path = require('path');
tmpdir.refresh();

{
// Should warn when trying to delete a file
common.expectWarning(
'DeprecationWarning',
'In future versions of Node.js, fs.rmdir(path, { recursive: true }) ' +
Expand All @@ -18,6 +17,6 @@ tmpdir.refresh();
const filePath = path.join(tmpdir.path, 'rmdir-recursive.txt');
fs.writeFileSync(filePath, '');
fs.rmdir(filePath, { recursive: true }, common.mustCall((err) => {
assert.strictEqual(err.code, 'ENOTDIR');
assert.strictEqual(err.code, common.isWindows ? 'ENOENT' : 'ENOTDIR');
}));
}

0 comments on commit 8e1e85e

Please sign in to comment.