Skip to content

[Feature] Add invalid semver coverage for prepareDebuggerWorkerURL debugger-ui fallback #2759

Description

@EmmaYuan1015

Background

In scriptImporter.ts:141, prepareDebuggerWorkerURL falls back to the debugger-ui path when the React Native version is an invalid semver string. This is intentional behavior, but current tests mostly cover valid semver, >=0.50, and canary-like cases. The invalid semver branch is not explicitly locked down.

Problem

The invalid semver branch is not directly asserted in tests.
Refactors could unintentionally change fallback behavior without clear test protection.
Expected Outcome

Add explicit tests for invalid semver input and assert the debugger-ui URL is returned.
Make this branch behavior stable and regression-safe.

Scope

Add a test in scriptImporter.test.ts
input: not-a-semver
expected: [http://localhost:8081/debugger-ui/debuggerWorker.js]
Add matching coverage in appWorker.test.ts within the ScriptImporter test suite to keep behavior checks aligned.

Acceptance Criteria

New invalid semver tests pass.
No new static/type errors are introduced in modified test files.
prepareDebuggerWorkerURL behavior remains covered for:
RN < 0.50
RN >= 0.50
canary-like versions
invalid semver
explicit debuggerWorkerUrlPath override

Impact

Test-only change; no production logic changes.
Low risk, improves branch coverage and regression protection.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions