From 4fc5ce450c901f868ea5040350cb9371d13a250f Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Thu, 25 Jan 2024 08:42:00 -0800 Subject: [PATCH] Only have a unit test for DEFLATE when the runtime supports CompressionStream('deflate-raw') --- tests/archive-compress.spec.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/archive-compress.spec.js b/tests/archive-compress.spec.js index df37a67..36afb34 100644 --- a/tests/archive-compress.spec.js +++ b/tests/archive-compress.spec.js @@ -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) + } });