test(browser-mode): add comprehensive e2e test coverage#929
Conversation
Summary of ChangesHello @fi3ework, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the end-to-end test coverage for the browser mode of Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds a comprehensive set of E2E tests for browser mode, covering entry override, environment variables, test listing, and the no-tests scenario. The new tests are well-structured, using fixtures effectively to isolate test cases. The assertions correctly validate the intended functionality. I have one suggestion to improve code readability in one of the new test files.
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive E2E test coverage for browser mode functionality in rstest, expanding the test suite to cover several important edge cases and configuration scenarios.
Changes:
- Added E2E tests for entry override configuration to ensure rstest properly controls the entry point
- Added E2E tests for environment variable handling in browser mode via process shim
- Added E2E tests for test listing (collect mode) functionality
- Added E2E tests for no-tests scenario with both default behavior and --passWithNoTests flag
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| e2e/browser-mode/noTests.test.ts | Tests behavior when no test files are found, verifying both default exit code 1 and --passWithNoTests flag behavior |
| e2e/browser-mode/list.test.ts | Tests the list command for browser mode, ensuring tests are properly collected without execution |
| e2e/browser-mode/env.test.ts | Tests environment variable injection into browser runtime via process shim |
| e2e/browser-mode/entryOverride.test.ts | Tests that rstest properly overrides user's entry file in browser mode |
| e2e/browser-mode/fixtures/ports.ts | Adds port assignments for new test fixtures (5204, 5206, 5208, 5212) |
| e2e/browser-mode/fixtures/no-tests/rstest.config.ts | Configuration for no-tests fixture with non-existent test directory |
| e2e/browser-mode/fixtures/list/rstest.config.ts | Configuration for list fixture |
| e2e/browser-mode/fixtures/list/tests/a.test.ts | Test file with regular, skip, and todo tests for list verification |
| e2e/browser-mode/fixtures/list/tests/b.test.ts | Test file with nested describe blocks for list verification |
| e2e/browser-mode/fixtures/env/rstest.config.ts | Configuration with environment variable settings including undefined value |
| e2e/browser-mode/fixtures/env/tests/env.test.ts | Tests verifying env variables are properly injected in browser |
| e2e/browser-mode/fixtures/entry-override/rstest.config.ts | Configuration for entry override testing |
| e2e/browser-mode/fixtures/entry-override/src/index.ts | User entry file that throws error to verify it's not executed |
| e2e/browser-mode/fixtures/entry-override/tests/smoke.test.ts | Simple test to verify browser mode works without executing user entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add E2E tests for entry override configuration - Add E2E tests for environment variable handling - Add E2E tests for test listing functionality - Add E2E tests for no-tests scenario - Create reusable fixtures for browser-mode test scenarios - Add shared port utility for test isolation
Summary
Related Links
Checklist