Skip to content

Conversation

@egordidenko
Copy link
Contributor

Description

Checklist

@egordidenko egordidenko requested a review from Copilot November 20, 2025 21:26
@egordidenko egordidenko merged commit c407104 into master Nov 20, 2025
8 of 9 checks passed
@egordidenko egordidenko deleted the fix/test-multipart-start branch November 20, 2025 21:26
Copilot finished reviewing on behalf of egordidenko November 20, 2025 21:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR re-enables the previously skipped multipartStart test suite by removing the .skip modifier and updates the error assertion for the "should be rejected with bad options" test case to use a regex pattern instead of an exact error message match.

  • Re-enabled the multipartStart test suite
  • Modified error assertion to use regex pattern matching
  • Split error type and message verification into two separate assertions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +47 to +50
await expect(upload).rejects.toThrow(UploadError)

await expect(upload).rejects.toThrow(
/File size can not be less than \d+ bytes\. Please use direct upload instead of multipart\./
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertion pattern used here is inconsistent with the rest of the test file. At line 33-35, a similar test uses toThrowError(new UploadError(...)) to assert both the error type and message in a single assertion. Consider using the same pattern for consistency:

await expect(upload).rejects.toThrowError(
  new UploadError(
    'File size can not be less than 10485760 bytes. Please use direct upload instead of multipart.'
  )
)

Alternatively, if the exact error message is dynamic (e.g., the byte count changes), the current approach with a regex is reasonable, but then the pattern should be applied consistently across all similar tests in this file.

Suggested change
await expect(upload).rejects.toThrow(UploadError)
await expect(upload).rejects.toThrow(
/File size can not be less than \d+ bytes\. Please use direct upload instead of multipart\./
await expect(upload).rejects.toThrowError(
new UploadError(
'File size can not be less than 10485760 bytes. Please use direct upload instead of multipart.'
)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants