Run Go WebAssembly tests directly in a browser, automating compilation, serving, and execution.
wasmbrowsertest is a Go tool that automates running Go WebAssembly (WASM) tests in a browser. It solves the problem of manually compiling tests to WASM, embedding them in HTML, and serving them by providing a single command that handles all these steps, executing tests directly in a browser environment.
Go developers writing code that targets WebAssembly and need to test their WASM modules in a browser context, especially those integrating browser-based testing into CI/CD pipelines.
Developers choose wasmbrowsertest because it integrates seamlessly with Go's test toolchain, requires minimal setup, and automates the entire browser testing workflow, saving time and reducing complexity compared to manual approaches.
Run WASM tests inside your browser
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates directly with Go's test toolchain using the -exec hook or a named binary, making browser-based WASM testing as simple as running GOOS=js GOARCH=wasm go test, as described in the Quickstart.
Automates the entire process of compiling tests to WASM, embedding in HTML, and serving, eliminating the cumbersome manual steps highlighted in the README's introduction.
Provides clear setup instructions for CI environments like Travis CI and GitHub Actions, including Chrome installation and binary configuration, ensuring smooth integration into pipelines.
Supports CPU profiling during test runs with the -cpuprofile flag and converts profiles to pprof format for native analysis with Go tools, as explained in the how-to section.
Efficiently handles Go 1.20+ coverage data by recommending -test.gocoverdir to avoid HTTP API overhead, with tips for merging coverage files, per the README.
Only works with Chrome or Blink-based browsers due to reliance on the Chrome DevTools Protocol; Firefox is excluded because geckodriver lacks console log capture, as admitted in the README.
Requires Chrome installation, which adds overhead and may not be feasible in all environments, such as lightweight containers or systems with strict software policies.
Involves manual steps like renaming the binary to go_js_wasm_exec and managing PATH, and may require additional tools like cleanenv to fix environment variable limit errors, adding friction.