MCPcopy
hub / github.com/gildas-lormeau/zip.js / test

Function test

tests/all/test-invalid-uncompressed-size.js:7–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5export { test };
6
7async function test() {
8 zip.configure({ chunkSize: 128, useWebWorkers: true });
9 const readable = (await fetch(new URL("../data/lorem-invalid-uncompressed-size.zip", import.meta.url))).body;
10 const zipReader = new zip.ZipReader(readable);
11 const entries = await zipReader.getEntries();
12 try {
13 await entries[0].arrayBuffer();
14 throw new Error();
15 } catch (error) {
16 if (error.message != zip.ERR_INVALID_UNCOMPRESSED_SIZE) {
17 throw error;
18 }
19 await zipReader.close();
20 } finally {
21 await zip.terminateWorkers();
22 }
23}

Callers

nothing calls this directly

Calls 3

getEntriesMethod · 0.95
closeMethod · 0.95
arrayBufferMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…