Description
wasmbrowsertest runs Go WebAssembly tests inside a real browser. Testing Go code that targets WebAssembly normally means compiling the test, loading it into an HTML page with wasm_exec.js, and serving that page with a static server. This tool does all of that. You run GOOS=js GOARCH=wasm go test as usual, and it executes the tests in a browser. The quickstart installs the tool with go install, renames the binary to go_js_wasm_exec and makes sure it is on your PATH, so go test uses it as the test runner. It works by using Go's support for an alternate executable for tests, or by setting the -exec flag. You can also take a CPU profile during the test with the -cpuprofile flag, which is converted to pprof format for analysis with the Go tools. Non-test programs can run the same way with go run. Setting WASM_HEADLESS to off shows the application running in a visible browser window. The README includes notes on using the tool in Travis CI. The project is public on GitHub and suits Go developers who target the browser.…
Highlights
- Runs Go wasm tests in a browser
- Works with go test and go run
- CPU profiling with pprof output
- Visible browser with WASM_HEADLESS=off
- Usable in continuous integration
Ratings & Reviews
No ratings yet
Be the first to rate Wasmbrowsertest.
People also visit
Wasmbrowsertest FAQ
What does wasmbrowsertest do?
It runs Go WebAssembly tests in a browser, so you do not have to build and serve test pages by hand.
How do I install it?
Run go install for the package, rename the binary to go_js_wasm_exec, and put it on your PATH.
How do I run the tests?
Use GOOS=js GOARCH=wasm go test as you normally would.
Can I see the app in a browser window?
Yes. Set WASM_HEADLESS to off when you run it, and the README says the application opens in a visible window.
Is it free?
The code is open source and public on GitHub.
What are the best Wasmbrowsertest alternatives?
Popular alternatives to Wasmbrowsertest include Browser Run, WPT and Wanix. See all Wasmbrowsertest alternatives












