nodejs / readable-stream

Node-core streams for userland
https://nodejs.org/api/stream.html
Other
1.03k stars 227 forks source link

Q&A: Why does enabling ES Modules breaks tests? #433

Closed Soremwar closed 4 years ago

Soremwar commented 4 years ago

The following test test-stream-pipe-without-listenerCount breaks when es-modules are enabled on tap.

However the expected behavior seems to only apply when this configuration is enabled, since listenerCount is disabled here

image

The test fails claiming listenerCount is not a function, which is obviously true, except when disabling es-modules on the tests. Which seems ilogical.

Is this caused by strict mode? How can it be overwritten to allow its usage with import/export?

mcollina commented 4 years ago

I would recommend to open an issue on the esm module. It's definitely a compatibility problem on their side.