Skip to content

Commit 90b2501

Browse files
committed
cleanup
1 parent 189a3f7 commit 90b2501

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/zip.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export class PenumbraZipWriter extends EventTarget {
5858
/** Save complete buffer */
5959
private saveBuffer = false;
6060

61+
/** Promise representing completion of the zip stream piping to the file sink */
62+
private pipePromise?: Promise<void>;
63+
6164
/** Zip buffer used for testing */
6265
private zipBufferPromise: Promise<ArrayBuffer> | undefined;
6366

@@ -82,9 +85,6 @@ export class PenumbraZipWriter extends EventTarget {
8285
/** Current zip archive size */
8386
private bytesWritten = 0;
8487

85-
/** Promise representing completion of the zip stream piping to the file sink */
86-
public pipePromise?: Promise<void>;
87-
8888
/**
8989
* Penumbra zip writer constructor
9090
* @param options - ZipOptions
@@ -112,7 +112,6 @@ export class PenumbraZipWriter extends EventTarget {
112112
'abort',
113113
() => {
114114
this.close().catch((error: unknown) => {
115-
logger.error(error, null);
116115
logger.error(
117116
`Failed to close zip writer: ${error instanceof Error ? error.message : String(error)}`,
118117
null,
@@ -168,6 +167,7 @@ export class PenumbraZipWriter extends EventTarget {
168167
if (saveBuffer && bufferedZipStream) {
169168
this.saveBuffer = saveBuffer;
170169
this.zipBufferPromise = new Response(bufferedZipStream).arrayBuffer();
170+
// Like `this.pipePromise.catch()`, ditto
171171
this.zipBufferPromise.catch((error: unknown) => {
172172
const asError =
173173
error instanceof Error

tests/api.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,6 @@ describe('penumbra.saveZip() error handling', () => {
647647
/penumbra\.saveZip\(\): Duplicate file/,
648648
);
649649
}
650-
651-
await writer.pipePromise;
652650
});
653651

654652
it('should throw error when getBuffer() is called before close', async () => {
@@ -801,7 +799,7 @@ describe('penumbra.saveZip() error handling', () => {
801799
}
802800
});
803801

804-
it.only('should handle multiple file write failures', async () => {
802+
it('should handle multiple file write failures', async () => {
805803
const writer = penumbra.saveZip({
806804
streamSaverEndpoint: 'https://streaming.transcend.io/endpoint.html',
807805
saveBuffer: true,

0 commit comments

Comments
 (0)