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

Function test

tests/all/test-arraybuffer.js:11–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9export { test };
10
11async function test() {
12 zip.configure({ chunkSize: 256 });
13 const zipStream = new TransformStream();
14 const zipWriter = new zip.ZipWriter(zipStream);
15 zipWriter.add(FILENAME, BLOB_STREAM);
16 zipWriter.close();
17 const zipReader = new zip.ZipReader(zipStream);
18 const entries = await zipReader.getEntries();
19 const data = await entries[0].arrayBuffer();
20 const text = new TextDecoder().decode(data);
21 await zipReader.close();
22 await zip.terminateWorkers();
23 if (TEXT_CONTENT != text) {
24 throw new Error();
25 }
26}

Callers

nothing calls this directly

Calls 5

addMethod · 0.95
closeMethod · 0.95
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…