Skip to content

Add integration tests for virtual-prefix URL routing - #2014

Open
robhogan wants to merge 1 commit into
mainfrom
pr2013
Open

robhogan wants to merge 1 commit into
mainfrom
pr2013

Conversation

@robhogan

@robhogan robhogan commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Recreating #1706 / D104259281 (@motiz88) for GH first without a diff attachment

Adds integration tests for [metro-project] and [metro-watchFolders] virtual URL prefixes: bundle requests, out-of-bounds index 404, and asset serving.

Removes Server unit tests that tested private methods (_resolveWatchFolderPrefix, _getEntryPointAbsolutePath) directly. The behaviours they covered are now tested end-to-end by the new integration tests and will also be covered by ProjectRouteMap unit tests in the next diff.

All tests pass without any production code changes.

Test plan:
See D104259281

@robhogan
robhogan added this pull request to stack #2016 October 3, 2026 21:33
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 3, 2026
@robhogan
robhogan marked this pull request as ready for review October 3, 2026 21:35
@robhogan
robhogan requested review from huntie and motiz88 and a balanced review from Copilot October 3, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

馃煛 Changes recommended

Asset serving remains untested and valid prefixed entry routing loses Windows coverage.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds integration coverage for virtual URL-prefix routing and documents unsupported runBuild prefix behavior.

Changes:

  • Adds bundle, source-map, and invalid-index routing tests.
  • Adds expected-failure build tests for filesystem-path semantics.
  • Removes private-method unit tests.
File Description
Server-test.js Removes direct prefix-resolution tests.
server-test.js Adds HTTP routing integration tests.
build-test.js Documents pending runBuild behavior.
rambundle-test.js Adds prefixed-entry rejection coverage.
LiteralDir.js Provides a literal-prefix fixture.

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +133 to +135
// TODO(T000000): Fix virtual-prefix URL resolution on Windows.
// path.sep differences cause entry point resolution to fail.
(process.platform === 'win32' ? test.skip : test)(
*Recreating #1706 / [D104259281](https://www.internalfb.com/diff/D104259281) (@motiz88) for GH first without a diff attachment*

Adds integration tests for `[metro-project]` and `[metro-watchFolders]` virtual URL prefixes: bundle requests, out-of-bounds index 404, and asset serving.

Removes Server unit tests that tested private methods (`_resolveWatchFolderPrefix`, `_getEntryPointAbsolutePath`) directly. The behaviours they covered are now tested end-to-end by the new integration tests and will also be covered by `ProjectRouteMap` unit tests in the next diff.

All tests pass without any production code changes.

Test plan:
See [D104259281](https://www.internalfb.com/diff/D104259281)
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 3, 2026
@robhogan

robhogan commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Re Copilot, the Windows test gap is closed by #2015, the next in the stack.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants