stream-chain
stream-chain copied to clipboard
Chain.on('finish', () => ...) no longer being called in `stream-chain` V3
We tried to bump our stream-chain from 2.2.5 to 3.4.0 but encountered an error where the .on('finish', () => ... never gets called anymore.
A min recreation as follows:
Code (using jest):
import { Readable } from 'stream';
import { chain } from 'stream-chain';
it('should recreate', async () => {
const pipelinePromise = new Promise((resolve) => {
const pipeline = chain([Readable.from([2]), (x: number) => x * x]);
pipeline.on('finish', () => {
console.error('finish');
resolve(undefined);
});
});
await pipelinePromise;
});
V2.2.5: Console logs the error message V3.4.0: Test timeout
Not sure the next steps, this is a confusing bit as the 3.4.0 type still list 'finish' as a valid option.