diff --git a/test/parallel/test-zlib-dictionary-fail.js b/test/parallel/test-zlib-dictionary-fail.js index 269b733e2c6d56..9546954841f4b1 100644 --- a/test/parallel/test-zlib-dictionary-fail.js +++ b/test/parallel/test-zlib-dictionary-fail.js @@ -53,7 +53,7 @@ const input = Buffer.from([0x78, 0xBB, 0x04, 0x09, 0x01, 0xA5]); stream.on('error', common.mustCall(function(err) { // It's not possible to separate invalid dict and invalid data when using // the raw format - assert.match(err.message, /invalid/); + assert.match(err.message, /(invalid|Operation-Ending-Supplemental Code is 0x12)/); })); stream.write(input); diff --git a/test/parallel/test-zlib-flush-drain-longblock.js b/test/parallel/test-zlib-flush-drain-longblock.js index 94d1d9d04d9369..e2f56ec76292bf 100644 --- a/test/parallel/test-zlib-flush-drain-longblock.js +++ b/test/parallel/test-zlib-flush-drain-longblock.js @@ -16,7 +16,7 @@ zipper.write('A'.repeat(17000)); zipper.flush(); let received = 0; -unzipper.on('data', common.mustCall((d) => { +unzipper.on('data', common.mustCallAtLeast((d) => { received += d.length; }, 2)); diff --git a/test/parallel/test-zlib-from-string.js b/test/parallel/test-zlib-from-string.js index fa96623536d279..92b6f8664666a0 100644 --- a/test/parallel/test-zlib-from-string.js +++ b/test/parallel/test-zlib-from-string.js @@ -55,7 +55,9 @@ const expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN4' + 'sHnHNzRtagj5AQAA'; zlib.deflate(inputString, common.mustCall((err, buffer) => { - assert.strictEqual(buffer.toString('base64'), expectedBase64Deflate); + zlib.inflate(buffer, common.mustCall((err, inflated) => { + assert.strictEqual(inflated.toString(), inputString); + })); })); zlib.gzip(inputString, common.mustCall((err, buffer) => {