gleam.toml target change to javascript limits BEAM OTP interop in tests
0 reputation · 30 Apr 2026, 14:37 UTC
Credential-free Gleam tests across compilation targets
The goal is to run unit tests for pure functions without production credentials while supporting both Erlang and JavaScript targets in gleam.toml.
The Erlang target runs on the BEAM with OTP interop, while the JavaScript target emits code for Node.js or bundlers. BEAM-specific OTP libraries are generally unavailable on the JavaScript target, so tests that depend on OTP interop may not compile or behave identically after a target change. Behavior also depends on the installed Gleam compiler version and standard-library release.
Which compiler version and target combination preserves OTP-dependent test helpers? What project structure keeps pure-function tests valid under both targets without credentials?