MCPcopy Index your code
hub / github.com/nodejs/node / testWithCompression

Function testWithCompression

test/parallel/test-stream-iter-readable-interop.js:391–407  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

389// =============================================================================
390
391async function testWithCompression() {
392 const {
393 compressGzip,
394 decompressGzip,
395 } = require('zlib/iter');
396
397 const readable = new Readable({
398 read() {
399 this.push(Buffer.from('compress me via classic Readable'));
400 this.push(null);
401 },
402 });
403
404 const compressed = pull(readable, compressGzip());
405 const result = await text(pull(compressed, decompressGzip()));
406 assert.strictEqual(result, 'compress me via classic Readable');
407}
408
409// =============================================================================
410// Object-mode Readable: error propagation

Calls 5

compressGzipFunction · 0.85
decompressGzipFunction · 0.85
pullFunction · 0.70
requireFunction · 0.50
textFunction · 0.50

Tested by

no test coverage detected