From bb9c21c1aff2949b648747825f1b482d389fd2ae Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sat, 5 May 2018 17:09:59 +0200 Subject: [PATCH] [test] Fix failing test on node 10 --- test/permessage-deflate.test.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/permessage-deflate.test.js b/test/permessage-deflate.test.js index ab2a9ab11..3d51bd57e 100644 --- a/test/permessage-deflate.test.js +++ b/test/permessage-deflate.test.js @@ -527,17 +527,14 @@ describe('PerMessageDeflate', function () { it("doesn't call the callback twice when `maxPayload` is exceeded", function (done) { const perMessageDeflate = new PerMessageDeflate({ threshold: 0 }, false, 25); const buf = Buffer.from('A'.repeat(50)); - const errors = []; perMessageDeflate.accept([{}]); perMessageDeflate.compress(buf, true, (err, data) => { if (err) return done(err); - perMessageDeflate.decompress(data, true, (err) => errors.push(err)); - perMessageDeflate._inflate.flush(() => { - assert.strictEqual(errors.length, 1); - assert.ok(errors[0] instanceof RangeError); - assert.strictEqual(errors[0].message, 'Max payload size exceeded'); + perMessageDeflate.decompress(data, true, (err) => { + assert.ok(err instanceof RangeError); + assert.strictEqual(err.message, 'Max payload size exceeded'); done(); }); });