fix: allow diskStorage without options and handle string destination in template - #1471
fix: allow diskStorage without options and handle string destination in template#1471vaibhavmashal wants to merge 2 commits into
Conversation
kilisamemarisaaa
left a comment
There was a problem hiding this comment.
Could we remove req.file.path before completing the new omitted-options test, and ideally clean up the adjacent default-destination test as well? I ran the new test alone on Windows while snapshotting os.tmpdir(): it passed, but left one new 1,778-byte file whose SHA-256 matched test/files/small0.dat. The full suite leaves two such files because successful uploads do not call _removeFile and the current afterEach only removes uploadDir.
|
Thanks for the thorough catch and review @kilisamemarisaaa! I've updated both the new omitted-options test and the adjacent default-destination test in \ est/disk-storage.js\ to call \s.unlink(req.file.path, done), ensuring any temporary files written to \os.tmpdir()\ are cleaned up before test completion. Pushed in commit 4ebb5af — all 133 tests continue to pass cleanly. |
kilisamemarisaaa
left a comment
There was a problem hiding this comment.
Reviewed head 4ebb5af. The omitted-options DiskStorage regression is covered, both successful temp-directory tests now unlink req.file.path, and the custom storage template handles omitted opts plus string destinations. I ran npm test (133 passing, 2 pending) and npm run lint locally on Windows. No blocking findings.
|
Thank you for the thorough review and verification, @kilisamemarisaaa! Glad everything is clean and passing. |
|
Just to note regarding the 2 pending tests on Windows: those are the Linux-specific file descriptor tests in \ est/abort-fd-leak.js\ and \ est/abort-unlink-after-close.js\ which check /proc/self/fd\ and gracefully \skip\ on non-Linux platforms. On Linux (and CI), all 135 tests execute and pass cleanly. |
Summary
Verification
pm run lint\ passed.
pm test\ passed (133 passing).