Skip to content

Comments

Fix test capturing return value from void function#217

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

Fix test capturing return value from void function#217
ienaga merged 2 commits intodevelopfrom
copilot/sub-pr-214-another-one

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

Addresses review feedback on PR #214: test case was capturing the return value of execute(), which is declared as void.

Changes

  • Modified test case6 in TextFieldSelectedFocusMoveUseCase.test.ts to not capture the return value
  • Aligned with the pattern used by other test cases in the file

Before:

it("execute test case6 - returns undefined", () => {
    const textField = new TextField();
    textField.text = "Test";
    textField.selectIndex = 2;
    
    const result = execute(textField);
    
    expect(result).toBeUndefined();
});

After:

it("execute test case6 - handles normal selectIndex", () => {
    const textField = new TextField();
    textField.text = "Test";
    textField.selectIndex = 2;
    
    expect(() => {
        execute(textField);
    }).not.toThrow();
});

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: ienaga <4123454+ienaga@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to address feedback from pull request #214 Fix test capturing return value from void function Oct 31, 2025
Copilot AI requested a review from ienaga October 31, 2025 23:01
@ienaga ienaga marked this pull request as ready for review October 31, 2025 23:14
Copilot AI review requested due to automatic review settings October 31, 2025 23:14
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 updates test assertions and removes unnecessary peer: true flags from package-lock.json dependencies.

  • Test case 6 refactored to use toThrow() assertion instead of checking toBeUndefined()
  • Removed peer: true flags from multiple npm package entries in package-lock.json

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/TextFieldSelectedFocusMoveUseCase.test.ts Updated test case 6 to verify the function doesn't throw instead of checking for undefined return value, improving test clarity
package-lock.json Removed peer: true flags from various package entries to correct dependency metadata

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

@ienaga ienaga merged commit bfe4326 into develop Oct 31, 2025
18 checks passed
@ienaga ienaga deleted the copilot/sub-pr-214-another-one 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