-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
test: refactor test-fs-error-messages.js #11096
Conversation
* group tests by error type * improve error validation for all messages * use assert.throws instead of try and catch * use arrow functions * add missing test for readdir * add missing test for readFileSync * remove unnecessary variables
fs.chmod(fn, 0o666, (err) => testEnoentError(fn, '', 'chmod', err)); | ||
fs.open(fn, 'r', 0o666, (err) => testEnoentError(fn, '', 'open', err)); | ||
fs.readFile(fn, (err) => testEnoentError(fn, '', 'open', err)); | ||
fs.readdir(fn, (err) => testEnoentError(fn, '', 'scandir', err)); |
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.
Any reason why the syscall
parameter (3rd) is passed as scandir
and not readdir
?
Also the readFile
is passing open
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.
That's the operation showing at the error message for both cases
* group tests by error type * improve error validation for all messages * use assert.throws instead of try and catch * use arrow functions * add missing test for readdir * add missing test for readFileSync * remove unnecessary variables PR-URL: #11096 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
Landed in 907ce8d |
@edsadr Adrian some tests are failing here, can you take a look. |
@italoacasas taking a look today |
@italoacasas the problem with this is that some error messages are different in few platforms, will need some refactor to make it happen, so I will ping you once I got the fix and test it myself with the different OS |
* group tests by error type * improve error validation for all messages * use assert.throws instead of try and catch * use arrow functions * add missing test for readdir * add missing test for readFileSync * remove unnecessary variables PR-URL: nodejs#11096 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
Is this PR still underway? @italoacasas @edsadr |
sorry, I was out because of family reasons, slowly coming back to be active... I think I will be back working again on my pending issues this week |
Added |
I am closing this for now. @edsadr please feel free to reopen this at any time if you find the time to look into this again! I still think it would be a good contribution. |
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test