chore: finish piping and stuff and making it lovely
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -59,6 +59,7 @@ describe('ZipArchiveResponse', () => {
|
||||
content: expect.any(Function),
|
||||
},
|
||||
]);
|
||||
|
||||
const contents = await Promise.all(files.map(f => f.content()));
|
||||
expect(contents.map(c => c.toString('utf8').trim())).toEqual([
|
||||
'site_name: Test',
|
||||
|
||||
@@ -190,8 +190,9 @@ export class ZipArchiveResponse implements ReadTreeResponse {
|
||||
}
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const file = fs.createWriteStream(platformPath.join(dir, entryPath));
|
||||
file.on('error', reject);
|
||||
file.on('finish', resolve);
|
||||
|
||||
content.on('error', reject);
|
||||
content.pipe(file);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user