Skip to content

Commit 8e1e85e

Browse files
committed
fixup! fs: remove permissive rmdir recursive
1 parent d45a98b commit 8e1e85e

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

test/parallel/test-fs-rmdir-recursive-sync-warns-on-file.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const path = require('path');
88
tmpdir.refresh();
99

1010
{
11-
// Should warn when trying to delete a file
1211
common.expectWarning(
1312
'DeprecationWarning',
1413
'In future versions of Node.js, fs.rmdir(path, { recursive: true }) ' +
@@ -19,6 +18,6 @@ tmpdir.refresh();
1918
fs.writeFileSync(filePath, '');
2019
assert.throws(
2120
() => fs.rmdirSync(filePath, { recursive: true }),
22-
{ code: 'ENOTDIR' }
21+
{ code: common.isWindows ? 'ENOENT' : 'ENOTDIR' }
2322
);
2423
}

test/parallel/test-fs-rmdir-recursive-warns-on-file.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const path = require('path');
88
tmpdir.refresh();
99

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

0 commit comments

Comments
 (0)