-
Notifications
You must be signed in to change notification settings - Fork 30.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
test: refactor test-beforeexit-event-exit.js #10577
Conversation
Perhaps too tangentially related to this change, but since "refactor" is general, perhaps not?: We have (at least) three test files for the
Perhaps we can take this opportunity to rename them all to |
A search for 'beforeExit' in the test directory returned 9 files. If you let me know exactly which ones you want renamed (just the three you mentioned above?), I can rename them in another commit. |
@cjihrig Looking more closely at it, two of the tests are awfully similar and could/should probably be merged. I have a feeling once we start pulling on this thread, lots of other things may shake out, so, uh, yeah, never mind. :-D I'll probably try to sort it out after this lands. |
(Actually, if you could just rename this test to |
I commented elsewhere, but it looks to me like use of |
@@ -1,9 +1,8 @@ | |||
'use strict'; | |||
require('../common'); | |||
var assert = require('assert'); | |||
const common = require('../common'); | |||
|
|||
process.on('beforeExit', function() { |
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.
common.mustCall(..., 0)
also will work in this case I guess.
@sam-github You make some good points here and elsewhere. The counterargument is that knowing to do that conversion is one more piece of friction. "I know I'm looking for a beforeExit test. Let's look for tests with beforeExit in the name! None? OK. Maybe it's beforeexit. Or before-exit. Or something, I guess?" I'd rather there be just one and only one name for the event/method/whatever, not different names depending on if I'm looking for a filename or not. I don't feel that strongly enough about it to push for it, and in the absence of a champion, status quo wins out. Sadly, it's not just the 43 mixed case files to consider changing. It's also lowercase everything vs. kebab-case everything: test-fs-readfilesync-pipe-large.js or test-fs-read-file-sync-hostname.js. :-( TL;DR: We can leave this filename as is. :-D |
agreed, the mapping should be clear and consistent. Could be I've been burned to badly with projects that literally could not be checked out on OS X or Windows because of case changes, and yes, that was with Subversion, but my interactions with tooling on mixed case projects have been poor at times. In this case, if there is a majority practice, I'd document it, and then we can evolve towards it. |
PR-URL: nodejs#10577 Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#10577 Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#10577 Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #10577 Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#10577 Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#10577 Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #10577 Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #10577 Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs/node#10577 Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test