Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

edsadr
Copy link
Member

@edsadr edsadr commented Feb 1, 2017

  • 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), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

* 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
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 1, 2017
@mscdex mscdex added the fs Issues and PRs related to the fs subsystem / file system. label Feb 1, 2017
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));
Copy link
Contributor

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

Copy link
Member Author

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

@italoacasas
Copy link
Contributor

jasnell pushed a commit that referenced this pull request Feb 3, 2017
* 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>
@jasnell
Copy link
Member

jasnell commented Feb 3, 2017

Landed in 907ce8d

@jasnell jasnell closed this Feb 3, 2017
@jasnell jasnell mentioned this pull request Feb 3, 2017
4 tasks
@italoacasas italoacasas reopened this Feb 4, 2017
@italoacasas
Copy link
Contributor

@edsadr Adrian some tests are failing here, can you take a look.

@edsadr
Copy link
Member Author

edsadr commented Feb 6, 2017

@italoacasas taking a look today

@edsadr edsadr mentioned this pull request Feb 7, 2017
3 tasks
@edsadr
Copy link
Member Author

edsadr commented Feb 7, 2017

@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

@addaleax addaleax added the wip Issues and PRs that are still a work in progress. label Feb 16, 2017
krydos pushed a commit to krydos/node that referenced this pull request Feb 25, 2017
* 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>
@hiroppy
Copy link
Member

hiroppy commented Mar 2, 2017

Is this PR still underway? @italoacasas @edsadr

@edsadr
Copy link
Member Author

edsadr commented Mar 27, 2017

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

@gibfahn
Copy link
Member

gibfahn commented Jun 17, 2017

Added dont-land-on-v6.x as this was reverted, if it lands again in the future feel free to remove that label.

@BridgeAR
Copy link
Member

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.

@BridgeAR BridgeAR closed this Aug 26, 2017
@BridgeAR BridgeAR added stalled Issues and PRs that are stalled. and removed wip Issues and PRs that are still a work in progress. labels Aug 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. stalled Issues and PRs that are stalled. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.