Currently EventEmitter can be pretty finicky at the edges where it touches other APIs, especially when interacting with bun:test and a few other places like node:stream.
It would probably be good to:
Add test coverage for EventEmitter + bun:test to make sure all edge and corner cases are dealt with appropriately. This is includes where done is called inside of event listeners, for both passing and failing expect statements. There are probably other cases which should be tested to, but this is the one I've just encountered that was causing the runner to hang.
Copy Node's tests for EventEmitter over, so we can make sure our EventEmitter conforms exactly to Node's spec, since Node's APIs really like to use EventEmitter a lot.
This should help improve the stability of a large segment of Bun's Node polyfills and places where Bun's APIs interact with them.
Currently
EventEmitter
can be pretty finicky at the edges where it touches other APIs, especially when interacting withbun:test
and a few other places likenode:stream
.It would probably be good to:
EventEmitter
+bun:test
to make sure all edge and corner cases are dealt with appropriately. This is includes wheredone
is called inside of event listeners, for both passing and failingexpect
statements. There are probably other cases which should be tested to, but this is the one I've just encountered that was causing the runner to hang.EventEmitter
over, so we can make sure ourEventEmitter
conforms exactly to Node's spec, since Node's APIs really like to useEventEmitter
a lot.This should help improve the stability of a large segment of Bun's Node polyfills and places where Bun's APIs interact with them.