Skip to content

test: split shortcuts case to fix test timeout#489

Merged
9aoy merged 3 commits intomainfrom
split-test-shortcuts
Aug 19, 2025
Merged

test: split shortcuts case to fix test timeout#489
9aoy merged 3 commits intomainfrom
split-test-shortcuts

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Aug 19, 2025

Summary

split shortcuts case to fix test timeout.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings August 19, 2025 09:25
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 19, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit a7d0faa
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68a4441f9ec57f00081610b0
😎 Deploy Preview https://deploy-preview-489--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
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 refactors the CLI shortcuts test by splitting a single test case into multiple test cases to resolve test timeout issues. The change moves from inline fixture setup to using dedicated fixture files and separates test scenarios.

  • Split single test case into multiple focused test cases
  • Extract inline fixture setup into dedicated fixture files
  • Update test exclusion patterns in configuration to be more generic

Reviewed Changes

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

Show a summary per file
File Description
e2e/watch/shortcuts.test.ts Split single test into multiple cases and simplified fixture setup
e2e/watch/fixtures-shortcuts/src/index.ts New fixture file with simple export function
e2e/watch/fixtures-shortcuts/rstest.config.ts New fixture configuration file with TTY and reporter settings
e2e/watch/fixtures-shortcuts/index1.test.ts New failing test fixture for testing shortcuts
e2e/watch/fixtures-shortcuts/index.test.ts New passing test fixture for testing shortcuts
e2e/rstest.config.ts Updated exclusion pattern to be more generic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

await cli.waitForStdout('Duration');
expect(cli.stdout).toMatch('Tests 1 failed | 1 passed');

cli.exec.kill();
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

The test lacks proper cleanup in the second test case. The first test case calls cli.exec.kill() but the second test case doesn't have this cleanup, which could lead to resource leaks or interference between tests.

Copilot uses AI. Check for mistakes.
cli.exec.kill();
});

it('shortcut `f` should works as expected', async () => {
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

Grammar error in test description. 'should works' should be 'should work' (without the 's').

Suggested change
it('shortcut `f` should works as expected', async () => {
it('shortcut `f` should work as expected', async () => {

Copilot uses AI. Check for mistakes.
@9aoy 9aoy merged commit 355cf92 into main Aug 19, 2025
16 checks passed
@9aoy 9aoy deleted the split-test-shortcuts branch August 19, 2025 09:37
@9aoy 9aoy mentioned this pull request Aug 20, 2025
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.

2 participants