Overview of the Web (js/wasm) test harness
releaseThe Web (js/wasm) test harness is a tool designed to run the internal test suite inside a real browser against a Godot web export. It operates headlessly and reports pass/fail results to CI.
Workflow
- Build & Serve: Running
gd test(withGOOS=js) builds thego testbinary tolibrary.wasm, downloads the Godot web export template, and executes the Godot Web export preset. This produces a standard Godot web build (index.html,index.wasm,index.pck) alongside the Golibrary.wasmandwasm_exec.js. The result is served on:$PORTwith the required cross-origin-isolation headers. - Browser Execution:
run_browser_test.mjslaunches headless Chromium via the DevTools protocol. Go's stdout is routed toconsole.logviawasm_exec.js, allowing standardgo testoutput to appear in the browser console.
Exit Codes
0:PASS/okline detected.1:FAIL/--- FAIL/exit code: N/panic/uncaught exception detected.2: Timeout occurred.