1
0
Fork 0
mirror of https://github.com/codedread/bitjs synced 2025-10-03 01:29:17 +02:00

Only have a unit test for DEFLATE when the runtime supports CompressionStream('deflate-raw')

This commit is contained in:
Jeff Schiller 2024-01-25 08:42:00 -08:00
parent 6c19e3a908
commit 4fc5ce450c

View file

@ -62,9 +62,11 @@ describe('bitjs.archive.compress', () => {
});
});
it('zipper works for DEFLATE, where supported', async () => {
const files = new Map(inputFileInfos);
try {
try {
new CompressionStream('deflate-raw');
it('zipper works for DEFLATE, where deflate-raw is supported', async () => {
const files = new Map(inputFileInfos);
const zipper = new Zipper({zipCompressionMethod: ZipCompressionMethod.DEFLATE});
const byteArray = await zipper.start(Array.from(files.values()), true);
@ -82,8 +84,8 @@ describe('bitjs.archive.compress', () => {
}
});
await unarchiver.start();
} catch (err) {
// Do nothing. This runtime did not support DEFLATE. (Node < 21.2.0)
}
});
});
} catch (err) {
// Do nothing. This runtime did not support DEFLATE. (Node < 21.2.0)
}
});