Skip to content

test(browser-mode): add comprehensive e2e test coverage#929

Merged
fi3ework merged 1 commit intomainfrom
more-b-e2e
Feb 3, 2026
Merged

test(browser-mode): add comprehensive e2e test coverage#929
fi3ework merged 1 commit intomainfrom
more-b-e2e

Conversation

@fi3ework
Copy link
Copy Markdown
Member

@fi3ework fi3ework commented Feb 3, 2026

Summary

  • 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

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings February 3, 2026 03:53
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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 rstest. It introduces new test suites and fixtures to validate critical functionalities such as entry point overriding, environment variable injection, accurate test listing, and correct behavior when no test files are discovered. These additions improve the robustness and reliability of the browser testing environment by ensuring core features work as intended.

Highlights

  • Entry Override E2E Tests: Added comprehensive end-to-end tests to ensure that rstest correctly overrides the user's rsbuild entry point when running in browser mode, preventing unintended execution of user-defined entries.
  • Environment Variable E2E Tests: Introduced E2E tests to validate the proper injection and handling of environment variables within the browser runtime via a process shim, ensuring configuration is applied as expected.
  • Test Listing E2E Tests: Implemented E2E tests for the test listing functionality in browser mode, verifying that rstest list accurately collects and displays browser tests, correctly excluding skipped or todo tests.
  • No Tests Scenario E2E Tests: Added E2E tests to cover scenarios where no test files are found in browser mode, confirming the expected exit codes (defaulting to 1, or 0 with --passWithNoTests flag).
Changelog
  • e2e/browser-mode/entryOverride.test.ts
    • Added new E2E test to verify rstest's entry point override mechanism in browser mode.
  • e2e/browser-mode/env.test.ts
    • Added new E2E test to confirm environment variable injection into the browser runtime.
  • e2e/browser-mode/fixtures/entry-override/rstest.config.ts
    • Added configuration for the entry-override fixture, enabling browser mode and setting up a dedicated port.
  • e2e/browser-mode/fixtures/entry-override/src/index.ts
    • Added a dummy entry file for the entry-override fixture to confirm it's not executed by rstest.
  • e2e/browser-mode/fixtures/entry-override/tests/smoke.test.ts
    • Added a basic smoke test for the entry-override fixture to ensure normal test execution.
  • e2e/browser-mode/fixtures/env/rstest.config.ts
    • Added configuration for the env fixture, defining browser mode settings and custom environment variables for testing.
  • e2e/browser-mode/fixtures/env/tests/env.test.ts
    • Added test file for the env fixture, asserting correct exposure and modification of process.env in the browser.
  • e2e/browser-mode/fixtures/list/rstest.config.ts
    • Added configuration for the list fixture, enabling browser mode and setting a test timeout.
  • e2e/browser-mode/fixtures/list/tests/a.test.ts
    • Added test file for the list fixture, including it.skip and it.todo to verify correct listing behavior.
  • e2e/browser-mode/fixtures/list/tests/b.test.ts
    • Added another test file for the list fixture, demonstrating nested describe blocks for listing.
  • e2e/browser-mode/fixtures/no-tests/rstest.config.ts
    • Added configuration for the no-tests fixture, intentionally pointing to a non-existent test directory.
  • e2e/browser-mode/fixtures/ports.ts
    • Added new port assignments for the list, no-tests, entry-override, and env browser mode E2E test fixtures.
  • e2e/browser-mode/list.test.ts
    • Added new E2E test to verify that rstest list correctly collects browser tests and excludes skipped/todo tests.
  • e2e/browser-mode/noTests.test.ts
    • Added new E2E test to confirm rstest's behavior when no test files are found, including exit codes.
Activity
  • No human activity (comments, reviews) has been recorded on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

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 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
@fi3ework fi3ework merged commit 5de6332 into main Feb 3, 2026
15 of 17 checks passed
@fi3ework fi3ework deleted the more-b-e2e branch February 3, 2026 06:02
@fi3ework fi3ework mentioned this pull request Feb 3, 2026
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