Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/common/mqtt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { MqttClient, MqttClientConnection, QoS, MqttWill, Payload } from '@awscr
import { AwsIotMqttConnectionConfigBuilder } from '@awscrt/aws_iot';
import { fromUtf8 } from '@aws-sdk/util-utf8-browser';
import {once} from "events";
import * as io from "../native/io";

jest.setTimeout(10000);

Expand Down Expand Up @@ -59,6 +60,7 @@ test_env.conditional_test(test_env.AWS_IOT_ENV.mqtt311_is_valid_iot_cred())('MQT
});

test_env.conditional_test(test_env.AWS_IOT_ENV.mqtt311_is_valid_iot_cred())('MQTT Pub/Sub', async () => {
io.enable_logging(io.LogLevel["TRACE"])
const connection = await makeConnection();

let onConnect = once(connection, 'connect');
Expand Down Expand Up @@ -86,7 +88,8 @@ test_env.conditional_test(test_env.AWS_IOT_ENV.mqtt311_is_valid_iot_cred())('MQT
await expect(sub).resolves.toBeTruthy();

const publishResult = connection.publish(test_topic, test_payload, QoS.AtLeastOnce);
await expect(publishResult).resolves.toBeTruthy();
// Cause an error by changing this from toBeTruthy to toBeFalsy
await expect(publishResult).resolves.toBeFalsy();

await messageReceivedPromise;

Expand Down
Loading