lpil / lpil/gleeunit

`panic` does not trigger a failed test when within a JavaScript Promise

Open
#62 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Gleam
Stars
49
Forks
38
PR merge metrics
No merged PRs in 30d

Description

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:

```gleam
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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the minimal Gleam example through gleeunit.main and compare its behavior with direct execution under Node, Deno, and Bun. Trace how gleeunit handles Promise callbacks and panic failures; done means the example reports a failed test rather than passing, consistently with those runtimes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.