node/test/parallel/test-zlib-write-after-close.js
Jason Wilson 8fdb6c24f9
test: throw check in test-zlib-write-after-close
PR-URL: https://github.com/nodejs/node/pull/11482
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
2017-02-24 02:16:27 +01:00

10 lines
334 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const zlib = require('zlib');
zlib.gzip('hello', common.mustCall(function(err, out) {
const unzip = zlib.createGunzip();
unzip.close(common.mustCall(function() {}));
assert.throws(() => unzip.write(out), /^Error: zlib binding closed$/);
}));