Skip to content

Commit f445dfd

Browse files
committed
fixup! tools: add GitHub Action linter for pr-url
1 parent 5a19fd4 commit f445dfd

5 files changed

+11
-52
lines changed

test/parallel/test-fs-rmdir-recursive-sync-warns-not-found.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

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

Lines changed: 0 additions & 21 deletions
This file was deleted.

test/parallel/test-fs-rmdir-recursive-warns-not-found.js renamed to test/parallel/test-fs-rmdir-recursive-throws-not-found.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ tmpdir.refresh();
2121
path.join(tmpdir.path, 'noexist.txt'),
2222
{ recursive: true },
2323
common.mustCall((err) => {
24-
assert.throws(() => { throw err; }, {
25-
code: 'ENOENT',
26-
});
24+
assert.strictEqual(err.code, 'ENOENT');
2725
})
2826
);
2927
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ tmpdir.refresh();
1818
const filePath = path.join(tmpdir.path, 'rmdir-recursive.txt');
1919
fs.writeFileSync(filePath, '');
2020
fs.rmdir(filePath, { recursive: true }, common.mustCall((err) => {
21-
assert.throws(() => { throw err; }, {
22-
code: 'ENOTDIR',
23-
});
21+
assert.strictEqual(err.code, 'ENOTDIR');
2422
}));
2523
}
2624
{

test/parallel/test-fs-rmdir-recursive.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ function removeAsync(dir) {
7373

7474
// Recursive removal should succeed.
7575
fs.rmdir(dir, { recursive: true }, common.mustSucceed(() => {
76-
// No error should occur if recursive and the directory does not exist.
77-
fs.rmdir(dir, { recursive: true }, common.mustSucceed(() => {
76+
// An error should occur if recursive and the directory does not exist.
77+
fs.rmdir(dir, { recursive: true }, common.mustCall((err) => {
78+
assert.strictEqual(err.code, 'ENOENT');
7879
// Attempted removal should fail now because the directory is gone.
7980
fs.rmdir(dir, common.mustCall((err) => {
8081
assert.strictEqual(err.syscall, 'rmdir');
@@ -119,8 +120,9 @@ function removeAsync(dir) {
119120
// Recursive removal should succeed.
120121
fs.rmdirSync(dir, { recursive: true });
121122

122-
// No error should occur if recursive and the directory does not exist.
123-
fs.rmdirSync(dir, { recursive: true });
123+
// An error should occur if recursive and the directory does not exist.
124+
assert.throws(() => fs.rmdirSync(dir, { recursive: true }),
125+
{ code: 'ENOENT' });
124126

125127
// Attempted removal should fail now because the directory is gone.
126128
assert.throws(() => fs.rmdirSync(dir), { syscall: 'rmdir' });
@@ -140,8 +142,9 @@ function removeAsync(dir) {
140142
// Recursive removal should succeed.
141143
await fs.promises.rmdir(dir, { recursive: true });
142144

143-
// No error should occur if recursive and the directory does not exist.
144-
await fs.promises.rmdir(dir, { recursive: true });
145+
// An error should occur if recursive and the directory does not exist.
146+
await assert.rejects(fs.promises.rmdir(dir, { recursive: true }),
147+
{ code: 'ENOENT' });
145148

146149
// Attempted removal should fail now because the directory is gone.
147150
assert.rejects(fs.promises.rmdir(dir), { syscall: 'rmdir' });

0 commit comments

Comments
 (0)