Skip to content

Commit

Permalink
Add packetsInOrder option to abstractTest
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Jul 24, 2024
1 parent e4c6b17 commit b8600aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion abstractTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit b8600aa

Please sign in to comment.