1
0
mirror of synced 2026-05-22 14:43:19 +00:00

Fix closing Node.js stream in unit test

This commit is contained in:
Borewit
2025-01-29 19:49:19 +01:00
parent 4322df92d8
commit a5bc189540
+8 -1
View File
@@ -32,7 +32,14 @@ export const Parsers: IParser[] = [
try {
return await mm.parseStream(nodeStream, {mimeType: mimeType}, options);
} finally {
nodeStream.close();
await new Promise<void>((resolve, reject) => {
nodeStream.close(err => {
if (err)
reject(err);
else
resolve();
});
});
}
}
}, {