Skip to content

Commit

Permalink
Only have a unit test for DEFLATE when the runtime supports Compressi…
Browse files Browse the repository at this point in the history
…onStream('deflate-raw')
  • Loading branch information
codedread committed Jan 25, 2024
1 parent 6c19e3a commit 4fc5ce4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/archive-compress.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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)
}
});

0 comments on commit 4fc5ce4

Please sign in to comment.