Skip to content

Comments

Fix test checking return value of void function#218

Merged
ienaga merged 2 commits intodevelopfrom
copilot/sub-pr-214-yet-again
Oct 31, 2025
Merged

Fix test checking return value of void function#218
ienaga merged 2 commits intodevelopfrom
copilot/sub-pr-214-yet-again

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

Test case incorrectly captured and asserted the return value of execute(), which has a void return type.

Changes

  • Modified test case 15 to verify execute() doesn't throw instead of testing its return value
  • Aligned with pattern used by other test cases in the file
// Before
const result = execute(textField, event);
expect(result).toBeUndefined();

// After
expect(() => {
    execute(textField, event);
}).not.toThrow();

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI mentioned this pull request Oct 31, 2025
Co-authored-by: ienaga <4123454+ienaga@users.noreply.github.com>
Copilot AI changed the title [WIP] Update stacked pull request to address review feedback Fix test checking return value of void function Oct 31, 2025
Copilot AI requested a review from ienaga October 31, 2025 23:00
@ienaga ienaga marked this pull request as ready for review October 31, 2025 23:15
Copilot AI review requested due to automatic review settings October 31, 2025 23:15
Copy link
Contributor

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 improves test coverage and corrects package-lock.json configuration by refining a test case assertion and removing unnecessary "peer": true flags from dependency entries.

  • Updated test case 15 to verify the function doesn't throw instead of checking for undefined return
  • Removed incorrect "peer": true flags from package-lock.json entries

Reviewed Changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
packages/text/src/TextField/usecase/TextFieldKeyDownEventUseCase.test.ts Updated test case 15 to use .not.toThrow() assertion instead of checking for undefined return value, better aligning with the function's void return type
package-lock.json Removed "peer": true flags from various dependency entries to correct package configuration

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

@ienaga ienaga merged commit 0348a9d into develop Oct 31, 2025
21 checks passed
@ienaga ienaga deleted the copilot/sub-pr-214-yet-again branch November 1, 2025 00:20
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.

2 participants