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.
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.
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 <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
|
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 <jasnell@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
|
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