From b8600aa208cbbf0bb49072ddfaac70341c133785 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Wed, 24 Jul 2024 12:08:56 +0200 Subject: [PATCH] Add packetsInOrder option to abstractTest Signed-off-by: Matteo Collina --- abstractTest.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/abstractTest.js b/abstractTest.js index 258c34c..6865d2c 100644 --- a/abstractTest.js +++ b/abstractTest.js @@ -3,6 +3,7 @@ module.exports = function abstractTests (opts) { const builder = opts.builder const test = opts.test + const packetsInOrder = opts.packetsInOrder === undefined ? true : opts.packetsInOrder test('support on and emit', function (t) { t.plan(4) @@ -503,7 +504,7 @@ module.exports = function abstractTests (opts) { e.on(topic, function (msg, cb) { let fail = false - if (received !== msg.payload) { + if (packetsInOrder && received !== msg.payload) { t.fail(`leak detected. Count: ${received} - Payload: ${msg.payload}`) fail = true }