@ -3,10 +3,14 @@ import fs from 'fs';
export async function waitForStreamClose(
stream: fs.WriteStream
): Promise<void> {
stream.end();
return new Promise((resolve) => {
stream.once('finish', () => {
resolve();
});
return new Promise((resolve, reject) => {
stream
.once('finish', () => {
})
.once('error', () => {
reject();
}