diff --git a/package.json b/package.json index 30aed7b5..04f501a6 100644 --- a/package.json +++ b/package.json @@ -67,13 +67,13 @@ ], "license": "MIT", "devDependencies": { - "@types/node": "^12.6.8", - "@typescript-eslint/eslint-plugin": "^1.13.0", - "@typescript-eslint/parser": "^1.13.0", + "@types/node": "^12.7.2", + "@typescript-eslint/eslint-plugin": "^2.0.0", + "@typescript-eslint/parser": "^2.0.0", "compute-mode": "^1.0.0", "concat-stream": "^2.0.0", "convert-hrtime": "^3.0.0", - "coveralls": "^3.0.5", + "coveralls": "^3.0.6", "duplexify": "^4.1.1", "faucet": "0.0.1", "license-checker": "^25.0.1", @@ -82,7 +82,7 @@ "nyc": "^14.1.1", "pre-commit": "^1.2.2", "snazzy": "^8.0.0", - "standard": "^13.1.0", + "standard": "^14.0.2", "tape": "^4.11.0", "typescript": "^3.5.3", "websocket-stream": "^5.5.0" @@ -97,12 +97,12 @@ "fastseries": "^1.7.2", "from2": "^2.3.0", "mqemitter": "^3.0.0", - "mqtt-packet": "^6.2.0", + "mqtt-packet": "^6.2.1", "pump": "^3.0.0", "retimer": "^2.0.0", "reusify": "^1.0.4", "shortid": "^2.2.14", "through2": "^3.0.1", - "uuid": "^3.3.2" + "uuid": "^3.3.3" } } diff --git a/test/auth.js b/test/auth.js index 0ef5124b..f45bb315 100644 --- a/test/auth.js +++ b/test/auth.js @@ -589,7 +589,7 @@ test('negate subscription with correct persistence', function (t) { s.outStream.once('data', function (packet) { t.equal(packet.cmd, 'suback') t.deepEqual(packet.granted, [128, 0]) - broker.persistence.subscriptionsByClient(broker.clients['abcde'], function (_, subs, client) { + broker.persistence.subscriptionsByClient(broker.clients.abcde, function (_, subs, client) { t.deepEqual(subs, expected) }) t.equal(packet.messageId, 24) diff --git a/test/basic.js b/test/basic.js index d77aa019..88bfe47a 100644 --- a/test/basic.js +++ b/test/basic.js @@ -24,7 +24,7 @@ test('publish QoS 0', function (t) { s.broker.mq.on('hello', function (packet, cb) { expected.brokerId = s.broker.id expected.brokerCounter = s.broker.counter - t.equal(packet['messageId'], undefined, 'MUST not contain a packet identifier in QoS 0') + t.equal(packet.messageId, undefined, 'MUST not contain a packet identifier in QoS 0') t.deepEqual(packet, expected, 'packet matches') cb() t.end() @@ -232,13 +232,13 @@ test('client closes', function (t) { var broker = aedes() var brokerClient var client = noError(connect(setup(broker, false), { clientId: 'abcde' }, function () { - brokerClient = broker.clients['abcde'] + brokerClient = broker.clients.abcde t.equal(brokerClient.connected, true, 'client connected') t.equal(brokerClient.disconnected, false) eos(client.conn, t.pass.bind('client closes')) setImmediate(() => { brokerClient.close(function () { - t.equal(broker.clients['abcde'], undefined, 'client instance is removed') + t.equal(broker.clients.abcde, undefined, 'client instance is removed') }) t.equal(brokerClient.connected, false, 'client disconnected') t.equal(brokerClient.disconnected, true) @@ -260,7 +260,7 @@ test('broker closes', function (t) { eos(client.conn, t.pass.bind('client closes')) broker.close(function (err) { t.error(err, 'no error') - t.equal(broker.clients['abcde'], undefined, 'client instance is removed') + t.equal(broker.clients.abcde, undefined, 'client instance is removed') }) })) }) @@ -442,7 +442,7 @@ test('do not restore QoS 0 subscriptions when clean', function (t) { }, function () { subscribe(t, subscriber, 'hello', 0, function () { subscriber.inStream.end() - subscriber.broker.persistence.subscriptionsByClient(broker.clients['abcde'], function (_, subs, client) { + subscriber.broker.persistence.subscriptionsByClient(broker.clients.abcde, function (_, subs, client) { t.equal(subs, null, 'no previous subscriptions restored') }) publisher = connect(setup(broker), { diff --git a/test/connect.js b/test/connect.js index cdffc03a..174c8aad 100644 --- a/test/connect.js +++ b/test/connect.js @@ -283,10 +283,10 @@ test('second CONNECT Packet sent from a Client as a protocol violation and disco keepalive: 0 } var s = connect(setup(broker, false), { clientId: 'abcde' }, function () { - t.ok(broker.clients['abcde'].connected) + t.ok(broker.clients.abcde.connected) s.inStream.write(packet) setImmediate(() => { - t.equal(broker.clients['abcde'], undefined, 'client instance is removed') + t.equal(broker.clients.abcde, undefined, 'client instance is removed') t.ok(s.conn.destroyed, 'close connection if packet is a CONNECT after network is established') broker.close() t.end()