mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Use ephemeral port number for MQTT broker
This commit is contained in:
parent
7640bc029c
commit
ccc98370eb
@ -29,14 +29,13 @@ var httpNodeRoot = "/api";
|
||||
var mqttServer;
|
||||
var mosca = require('mosca');
|
||||
var moscaSettings = {
|
||||
port: 1883,
|
||||
port: parseInt(Math.random() * 16383 + 49152),
|
||||
persistence: {
|
||||
// Needs for retaining messages.
|
||||
factory: mosca.persistence.Memory
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// https://cookbook.nodered.org/
|
||||
describe('cookbook', function () {
|
||||
beforeEach(function () {
|
||||
@ -46,8 +45,12 @@ describe('cookbook', function() {
|
||||
before(function () {
|
||||
browser.call(function () {
|
||||
return new Promise(function (resolve, reject) {
|
||||
mqttServer = new mosca.Server(moscaSettings, function() {
|
||||
mqttServer = new mosca.Server(moscaSettings, function (err) {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -71,7 +74,7 @@ describe('cookbook', function() {
|
||||
|
||||
mqttOutNode.edit();
|
||||
mqttConfig.edit();
|
||||
mqttConfig.setServer("localhost");
|
||||
mqttConfig.setServer("localhost", moscaSettings.port);
|
||||
mqttConfig.clickOk();
|
||||
mqttOutNode.clickOk();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user