Skip to content

Commit 153405a

Browse files
committed
PnParser: Confirm decompressed text in zTXt chunk in unit test
1 parent ade8f1a commit 153405a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/image-parsers-png.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,5 +179,10 @@ describe('bitjs.image.parsers.PngParser', () => {
179179
expect(data.keyword).equals('Disclaimer');
180180
expect(data.compressionMethod).equals(0);
181181
expect(data.compressedText.byteLength).equals(17);
182+
183+
const blob = new Blob([data.compressedText.buffer]);
184+
const decompressedStream = blob.stream().pipeThrough(new DecompressionStream('deflate'));
185+
const decompressedText = await new Response(decompressedStream).text();
186+
expect(decompressedText).equals('Freeware.');
182187
});
183188
});

0 commit comments

Comments
 (0)