test: split shortcuts case to fix test timeout#489
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
e2e/watch/shortcuts.test.ts
Outdated
| cli.exec.kill(); | ||
| }); | ||
|
|
||
| it('shortcut `f` should works as expected', async () => { |
There was a problem hiding this comment.
Grammar error in test description. 'should works' should be 'should work' (without the 's').
| it('shortcut `f` should works as expected', async () => { | |
| it('shortcut `f` should work as expected', async () => { |
Summary
split shortcuts case to fix test timeout.
Related Links
Checklist