-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[browser] rename test-main.mjs #124270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[browser] rename test-main.mjs #124270
Conversation
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
There was a problem hiding this 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 renames the WASM test runner entrypoint from test-main.js to test-main.mjs so V8 can treat it as an ES module by default (avoiding the need for --module).
Changes:
- Update HTML entrypoints and build/test infrastructure to reference
test-main.mjsinstead oftest-main.js. - Update various MSBuild project properties/items that copy or point to the test runner JS file.
- Update logging/comments in the browser runtime/test harness to reflect the new filename and align formatting.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/tests/Common/wasm-test-runner/index.html | Update module script reference to test-main.mjs. |
| src/tests/Common/wasm-test-runner/WasmTestRunner.proj | Point WasmMainJSPath at test-main.mjs in runtime-test/. |
| src/tests/Common/Directory.Build.targets | Copy test-main.mjs into $(CORE_ROOT)\runtime-test\. |
| src/mono/wasm/data/aot-tests/ProxyProjectForAOTOnHelix.proj | Update WasmMainJSPath to test-main.mjs. |
| src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj | Copy test-main.mjs to test output instead of test-main.js. |
| src/mono/wasi/Wasi.Build.Tests/BuildTestBase.cs | Copy test-main.mjs into generated temp projects. |
| src/mono/sample/wasm/browser-bench/Console/Wasm.Console.Bench.Sample.csproj | Update WasmMainJSPath to test-main.mjs. |
| src/mono/sample/wasm/browser-bench/Console/Makefile | Update MAIN_JS to test-main.mjs. |
| src/mono/browser/test-main.mjs | Update log string to reflect .mjs name. |
| src/mono/browser/test-index.html | Update module script reference to test-main.mjs. |
| src/mono/browser/runtime/loader/globals.ts | Update “keep in sync” comment and minor formatting. |
| src/mono/browser/runtime/globals.ts | Update “keep in sync” comment and minor formatting. |
| eng/testing/tests.browser.targets | Copy/link test-main.mjs to wwwroot and default WasmMainJSPath to .mjs. |
| eng/testing/WasmRunnerTemplate.sh | Default --js-file to test-main.mjs. |
| eng/testing/WasmRunnerTemplate.cmd | Default --js-file to test-main.mjs. |
fc180f5 to
f0fc051
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
f0fc051 to
7a50e2f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are places in the repo where we still have --module:
https://github.com/search?q=repo%3Adotnet%2Fruntime%20%22--module%22&type=code
edit:
and shouldn't we remove https://github.com/dotnet/runtime/blob/main/src/mono/browser/test-main.js ?
Done, one of them is not V8.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

so that V8 testing works without
--moduleThis will need follow up in benchmark, which uses
test-main.jsas it'smain.js, we should change that anyway.