-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests for platform specific error codes for fs.rmdir on file #22095
Conversation
i've not tested this on windows (dont have a win machine), so could use some help with that :) |
CI (including Windows) : https://ci.nodejs.org/job/node-test-pull-request/16179/ |
…into test-rmdir-file * 'test-rmdir-file' of https://github.com/gautamarora/node: test: use only error codes test: error code on win vs posix for rmdir on file
@gautamarora Looks like some extra commits got pulled in here -- can you rebase on master and see if that fixes the issue? |
@gautamarora ping, could you rebase this on master, please? |
assert.throws(function() { | ||
fs.rmdirSync(f); | ||
}, /ENOTDIR/); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this?:
assert.throws(() => { fs.rmdirSync(f); }
common.isWindows ? /ENOENT/ : /ENOTDIR/);
Closing due to a long inactivity. @gautamarora thanks a lot for your contribution nevertheless. It is much appreciated. If you would like to continue working on this, please just open a new PR or leave a comment here. |
As per the discussion at #8797 and subsequent fix to documentation here,
fs.rmdir
has different error codes on windows vs posix systems.This PR adds a test case to account for this difference in error codes.
This PR also updates the existing test to wrap each "case" with an anonymous scope.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes