broccolijs / broccoli

Browser compilation library – an asset pipeline for applications that run in the browser
https://broccoli.build
MIT License
3.33k stars 217 forks source link

Fail test if we get an unhandled rejection #446

Closed stefanpenner closed 4 years ago

stefanpenner commented 4 years ago

Currently, the way out watcher <-> server interact, the watcher's promise will "hold" it's state, until a future HTTP request reads it, this isn't a bug, but will absolutely trigger the unhandled rejection warning.

Although this isn't a bug, there is value in the unhandled rejection warnings being meaningful.

I can currently thing of some options:

a. create a faux promise that doesn't trigger the unhandled rejection warning; this would allow us to hide the warning, without breaking public API b. have our watcher -> server promise, fulfill with a complex type{ value: unknown, type: 'FULFILLED', 'REJECTED' }; this allows the server full control, no warnings, but will also be a breaking change. b. do something totally different; I don't really thing that is needed here.


I am currently out of time for this today, but will think about it more and hopefully resolve this issue soon.