Skip to content

Commit

Permalink
fixup! tools: add GitHub Action linter for pr-url
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Feb 5, 2021
1 parent 5a19fd4 commit f445dfd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 52 deletions.
19 changes: 0 additions & 19 deletions test/parallel/test-fs-rmdir-recursive-sync-warns-not-found.js

This file was deleted.

21 changes: 0 additions & 21 deletions test/parallel/test-fs-rmdir-recursive-sync-warns-on-file.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ tmpdir.refresh();
path.join(tmpdir.path, 'noexist.txt'),
{ recursive: true },
common.mustCall((err) => {
assert.throws(() => { throw err; }, {
code: 'ENOENT',
});
assert.strictEqual(err.code, 'ENOENT');
})
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ tmpdir.refresh();
const filePath = path.join(tmpdir.path, 'rmdir-recursive.txt');
fs.writeFileSync(filePath, '');
fs.rmdir(filePath, { recursive: true }, common.mustCall((err) => {
assert.throws(() => { throw err; }, {
code: 'ENOTDIR',
});
assert.strictEqual(err.code, 'ENOTDIR');
}));
}
{
Expand Down
15 changes: 9 additions & 6 deletions test/parallel/test-fs-rmdir-recursive.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ function removeAsync(dir) {

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

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

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

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

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

0 comments on commit f445dfd

Please sign in to comment.