Skip to content

Commit f1e5518

Browse files
authored
fix(test): topicAliasMaximum tests (#1612)
1 parent afc067b commit f1e5518

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

lib/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ function MqttClient (streamBuilder, options) {
270270
debug('MqttClient :: options.keepalive', options.keepalive)
271271
debug('MqttClient :: options.reconnectPeriod', options.reconnectPeriod)
272272
debug('MqttClient :: options.rejectUnauthorized', options.rejectUnauthorized)
273-
debug('MqttClient :: options.properties.topicAliasMaximum', options.properties.topicAliasMaximum)
273+
debug('MqttClient :: options.properties.topicAliasMaximum', options.properties ? options.properties.topicAliasMaximum : undefined)
274274

275275
this.options.clientId = (typeof options.clientId === 'string') ? options.clientId : defaultId()
276276

test/client_mqtt5.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ describe('MQTT 5.0', function () {
2020
host: 'localhost',
2121
port: ports.PORTAND103,
2222
protocolVersion: 5,
23-
topicAliasMaximum: 3
23+
properties: {
24+
topicAliasMaximum: 3
25+
}
2426
}
2527
const client = mqtt.connect(opts)
2628
let publishCount = 0
@@ -468,7 +470,9 @@ describe('MQTT 5.0', function () {
468470
host: 'localhost',
469471
port: ports.PORTAND103,
470472
protocolVersion: 5,
471-
topicAliasMaximum: 3
473+
properties: {
474+
topicAliasMaximum: 3
475+
}
472476
}
473477
const client = mqtt.connect(opts)
474478
const server103 = new MqttServer(function (serverClient) {
@@ -502,7 +506,9 @@ describe('MQTT 5.0', function () {
502506
host: 'localhost',
503507
port: ports.PORTAND103,
504508
protocolVersion: 5,
505-
topicAliasMaximum: 3
509+
properties: {
510+
topicAliasMaximum: 3
511+
}
506512
}
507513
const client = mqtt.connect(opts)
508514
const server103 = new MqttServer(function (serverClient) {
@@ -536,7 +542,9 @@ describe('MQTT 5.0', function () {
536542
host: 'localhost',
537543
port: ports.PORTAND103,
538544
protocolVersion: 5,
539-
topicAliasMaximum: 3
545+
properties: {
546+
topicAliasMaximum: 3
547+
}
540548
}
541549
const client = mqtt.connect(opts)
542550
const server103 = new MqttServer(function (serverClient) {

0 commit comments

Comments
 (0)