Skip to content

Add coverage-focused tests for disk storage and middleware internals#1437

Open
ashish3011 wants to merge 1 commit into
expressjs:mainfrom
ashish3011:test/coverage-100-percent
Open

Add coverage-focused tests for disk storage and middleware internals#1437
ashish3011 wants to merge 1 commit into
expressjs:mainfrom
ashish3011:test/coverage-100-percent

Conversation

@ashish3011

Copy link
Copy Markdown
  • Added targeted test cases for the disk storage flow and multipart middleware internals to exercise previously uncovered branches.
  • This improves confidence in the upload lifecycle around destination handling, error propagation, cleanup behavior, and field-name validation.
  • The goal is to raise coverage for the affected internal modules and reduce the chance of regressions in core upload behavior.

Those two files were touched as a small implementation cleanup while I was adding the coverage tests.

lib/file-appender.js: I changed the placeholder-removal logic from the old bitwise-style check to a plain [idx >= 0] check. It is functionally equivalent, but it is clearer and easier to reason about.
lib/make-middleware.js: I changed the pending-file cleanup from [indexOf] + [splice] to a [filter]-based removal. That makes the removal step more robust when multiple completion paths are happening and avoids mutating the array in a less obvious way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant