test: refactor test-fs-error-messages.js
- 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
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
test