-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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: adding mustCall in test-fs-readfile-empty.js #27455
Conversation
|
||
const fn = fixtures.path('empty.txt'); | ||
|
||
fs.readFile(fn, function(err, data) { | ||
fs.readFile(fn, mustCall(function (err, data) { |
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.
please remove the space after function
:
function (err, data)
-> function(err, data)
@@ -27,20 +27,21 @@ require('../common'); | |||
const assert = require('assert'); | |||
const fs = require('fs'); | |||
const fixtures = require('../common/fixtures'); | |||
const { mustCall } = require('../common') |
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.
Hi, missing semicolon here:
const { mustCall } = require('../common') | |
const { mustCall } = require('../common'); |
Besides, remember to remove the duplicated require('..common');
in line 23 above if you require('../common')
here.
Nit/note for whoever lands this: Please change |
@@ -20,27 +20,27 @@ | |||
// USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
|
|||
'use strict'; | |||
require('../common'); |
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.
The common
module should be required in tests before any other module: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#lines-1-3
I’m a little surprised that the linter didn’t pick this up.
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.
Me too... 🤔
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
must be required before anything else
Landed in 9c2774e, thanks! You can visit https://www.nodetodo.org/next-steps/ for more ideas to contribute. |
PR-URL: #27455 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ouyang Yadong <[email protected]>
PR-URL: #27455 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ouyang Yadong <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes