Skip to content

test: assert ConnectAsync does not modify the caller's ConnectOptions - #3796

Merged
kblok merged 1 commit into
masterfrom
implement-upstream-change-15762
Nov 18, 2026
Merged

kblok merged 1 commit into
masterfrom
implement-upstream-change-15762

Conversation

@kblok

@kblok kblok commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Ports puppeteer/puppeteer#15762 (do not modify the options passed to launch and connect).

Upstream defaulted options.logger in place; PuppeteerSharp takes the logger through ILoggerFactory and never writes it into the options, so no production change is needed. This adds the upstream launcher.spec test should not modify the connect options. The PuppeteerNode.test.ts unit test (frozen options on launch) has no .NET equivalent.

Note: not run locally (build env lacks dev cert / tar issue); relying on CI.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added coverage confirming that connecting to a browser preserves the original connection option values.

…ns (upstream #15762)

Upstream stopped mutating the launch/connect options (logger defaulting). PuppeteerSharp
injects the logger via ILoggerFactory and never writes it into the options, so only the
upstream 'should not modify the connect options' test is ported.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request adds a test that checks whether Puppeteer.ConnectAsync preserves the BrowserWSEndpoint and Protocol values in a ConnectOptions instance.

Changes: Connect options preservation

Layer / File(s) Summary
Verify ConnectOptions remain unchanged
lib/PuppeteerSharp.Tests/LauncherTests/PuppeteerConnectTests.cs
Adds a test that connects with configured options, then checks that BrowserWSEndpoint and Protocol retain their original values.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other

Merge Risk: Minimal · up to 1a76b

This change only adds a test confirming that connecting does not modify the connect options. It has no production impact and is low risk to merge once CI passes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names a test-only change: a new test asserting that ConnectAsync leaves the caller's ConnectOptions unmodified. The raw summary confirms this, since it adds ShouldNotModifyTheConnectOptions …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names a test-only change: a new test asserting that ConnectAsync leaves the caller's ConnectOptions unmodified. The raw summary confirms this, since it adds ShouldNotModifyTheConnectOptions in PuppeteerConnectTests.cs and checks that BrowserWSEndpoint and Protocol keep their values. The title is specific, matches the single file change, and the test: prefix fits a test-only PR.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 99539bad-1491-46da-b795-4fba966ed7ed
Commits

Reviewing files that changed from the base of the PR and between 8a53894 and 1a76b7b.

Files selected for processing: 1

  • lib/PuppeteerSharp.Tests/LauncherTests/PuppeteerConnectTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

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.

1 participant