diff --git a/test/parallel/test-zlib-write-after-close.js b/test/parallel/test-zlib-write-after-close.js index 0c54270ec29b13..fdad1708c81ff0 100644 --- a/test/parallel/test-zlib-write-after-close.js +++ b/test/parallel/test-zlib-write-after-close.js @@ -6,7 +6,5 @@ const zlib = require('zlib'); zlib.gzip('hello', common.mustCall(function(err, out) { const unzip = zlib.createGunzip(); unzip.close(common.mustCall(function() {})); - assert.throws(function() { - unzip.write(out); - }); + assert.throws(() => unzip.write(out), /^Error: zlib binding closed$/); }));