I was experimenting with tests involving large amounts of JS Promises, and noticed that gleeunit ran into some issues with code involving Promises.
Here is a minimal example that passes in gleeunit but fails when run directly:
import gleam/javascript/promise
import gleeunit
pub fn main() -> Nil {
gleeunit.main()
}
pub fn main_test() -> Nil {
echo "testing"
let promise1 =
promise.new(fn(resolve) {
echo "testing promise"
panic
resolve("Hello, World!")
})
Nil
}
The expected behavior is to match Node/Deno/Bun, which all throw errors in execution.