Skip to content

Commit 4fc5ce4

Browse files
committed
Only have a unit test for DEFLATE when the runtime supports CompressionStream('deflate-raw')
1 parent 6c19e3a commit 4fc5ce4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/archive-compress.spec.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ describe('bitjs.archive.compress', () => {
6262
});
6363
});
6464

65-
it('zipper works for DEFLATE, where supported', async () => {
66-
const files = new Map(inputFileInfos);
67-
try {
65+
try {
66+
new CompressionStream('deflate-raw');
67+
68+
it('zipper works for DEFLATE, where deflate-raw is supported', async () => {
69+
const files = new Map(inputFileInfos);
6870
const zipper = new Zipper({zipCompressionMethod: ZipCompressionMethod.DEFLATE});
6971
const byteArray = await zipper.start(Array.from(files.values()), true);
7072

@@ -82,8 +84,8 @@ describe('bitjs.archive.compress', () => {
8284
}
8385
});
8486
await unarchiver.start();
85-
} catch (err) {
86-
// Do nothing. This runtime did not support DEFLATE. (Node < 21.2.0)
87-
}
88-
});
87+
});
88+
} catch (err) {
89+
// Do nothing. This runtime did not support DEFLATE. (Node < 21.2.0)
90+
}
8991
});

0 commit comments

Comments
 (0)