Comparing version 4.3.0 to 4.4.0
@@ -498,2 +498,31 @@ | ||
test('packets are emitted in order', function (t) { | ||
const e = builder() | ||
const total = 10000 | ||
const topic = 'test' | ||
var received = 0 | ||
e.on(topic, function (msg, cb) { | ||
var fail = false | ||
if (received !== msg.payload) { | ||
t.fail(`leak detected. Count: ${received} - Payload: ${msg.payload}`) | ||
fail = true | ||
} | ||
received++ | ||
if (fail || received === total) { | ||
e.close(function () { | ||
t.end() | ||
}) | ||
} | ||
cb() | ||
}) | ||
for (let payload = 0; payload < total; payload++) { | ||
e.emit({ topic, payload }) | ||
} | ||
}) | ||
test('calling emit without cb when closed doesn\'t throw error', function (t) { | ||
@@ -500,0 +529,0 @@ const e = builder() |
{ | ||
"name": "mqemitter", | ||
"version": "4.3.0", | ||
"version": "4.4.0", | ||
"description": "An Opinionated Message Queue with an emitter-style API", | ||
@@ -46,6 +46,6 @@ "main": "mqemitter.js", | ||
"devDependencies": { | ||
"@types/node": "^12.12.27", | ||
"@types/node": "^14.0.26", | ||
"@typescript-eslint/eslint-plugin": "^2.19.2", | ||
"@typescript-eslint/parser": "^2.19.2", | ||
"markdownlint-cli": "^0.22.0", | ||
"markdownlint-cli": "^0.23.2", | ||
"nyc": "^15.0.0", | ||
@@ -55,4 +55,4 @@ "pre-commit": "^1.2.2", | ||
"standard": "^14.3.1", | ||
"tape": "^4.13.0", | ||
"typescript": "^3.7.5" | ||
"tape": "^5.0.1", | ||
"typescript": "^4.0.2" | ||
}, | ||
@@ -59,0 +59,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34551
778