I'm using the latest istanbul + jasmine-node to write all my test scripts.
In a few places I have a Readable stream that may emit error
event, and I have no idea how to simulate such event in a test environment, to provide code coverage.
Can anybody suggest an idea of how to approach this, please?
It should just be as simple as emitting an error directly on the object:
stream.emit('error', new Error('OOPS'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With