test: extended test to makeCallback cb type check#12140
test: extended test to makeCallback cb type check#12140lucamaraschi wants to merge 1 commit intonodejs:masterfrom
Conversation
There was a problem hiding this comment.
Doesn't this delete the file? How about using another method that calls makeCallback() like, I don't know, fs.chmod()?
The comment should also be updated.
There was a problem hiding this comment.
Good point...but any of the operations which are calling makeCallback have an impact on the file. I would then use fs.mkdtemp which only creates a temp dir which we can delete at the end of the test. Does it make sense to you @lpinca?
83c8316 to
10a9547
Compare
jasnell
left a comment
There was a problem hiding this comment.
LGTM. One suggestion tho: the process.once('warning', ...) bit can be replaced by a call to common.expectWarning(...)
There was a problem hiding this comment.
Should this be os.tmpdir()? Alternatively, there is common.tmpDir for use in tests.
424fcb6 to
21f94d7
Compare
There was a problem hiding this comment.
This throws an error if the test is run in isolation node test/parallel/test-fs-make-callback.js and common.tmpDir has not been created.
I think it makes sense to run common.refreshTmpDir() at the beginning of the test.
21f94d7 to
c0b4f0d
Compare
There was a problem hiding this comment.
I'd use common.expectWarning() for consistency.
makeCallback and makeStatsCallback are both tested intedependently. Fixes: nodejs#12136
c0b4f0d to
bee1920
Compare
|
CI is green landing |
|
landed as 53828e8 |
|
Should this be backported to |
|
I'm backporting this with #12270 |
makeCallback and makeStatsCallback are both tested intedependently. PR-URL: #12140 Backport-PR-URL: #13785 Fixes: #12136 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
makeCallback and makeStatsCallback are both tested intedependently. PR-URL: #12140 Backport-PR-URL: #13785 Fixes: #12136 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
makeCallback and makeStatsCallback are both tested intedependently. PR-URL: #12140 Backport-PR-URL: #13785 Fixes: #12136 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
makeCallback and makeStatsCallback are both tested intedependently. PR-URL: nodejs/node#12140 Fixes: nodejs/node#12136 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
makeCallback and makeStatsCallback are both tested intedependently.
Fixes: #12136
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test, fs