node/test/parallel/test-zlib-zero-byte.js
Ishan Aditya 7a46554dcf test: var variables to const in zlib
Changes in test-zlib-from-string is because var->const
pushed us over the max char limit per line.

PR-URL: https://github.com/nodejs/node/pull/8627
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-09-20 10:54:56 -04:00

19 lines
417 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const zlib = require('zlib');
const gz = zlib.Gzip();
const emptyBuffer = Buffer.alloc(0);
var received = 0;
gz.on('data', function(c) {
received += c.length;
});
gz.on('end', common.mustCall(function() {
assert.strictEqual(received, 20);
}));
gz.on('finish', common.mustCall(function() {}));
gz.write(emptyBuffer);
gz.end();