Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
callemand committed Oct 23, 2023
1 parent 07c2c22 commit fe02eac
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/test/services/mqtt/lib/configureContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ const proxiquire = require('proxyquire').noCallThru();

const { assert, fake } = sinon;

const gladys = {};
const gladys = {
event: {
on: fake.resolves(null),
},
};
const mqttClient = {};
const serviceId = 'faea9c35-759a-44d5-bcc9-2af1de37b8b4';

Expand Down
1 change: 1 addition & 0 deletions server/test/services/mqtt/lib/connect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('mqttHandler.connect', () => {
const gladys = {
event: {
emit: fake.returns(null),
on: fake.resolves(null),
},
};
const configuration = {
Expand Down
3 changes: 3 additions & 0 deletions server/test/services/mqtt/lib/getConfiguration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const serviceId = 'faea9c35-759a-44d5-bcc9-2af1de37b8b4';
describe('mqttHandler.getConfiguration', () => {
it('should getConfiguration: not Docker', async () => {
const gladys = {
event: {
on: fake.resolves(null),
},
variable: {
getValue: fake.resolves('value'),
},
Expand Down
1 change: 1 addition & 0 deletions server/test/services/mqtt/lib/handleNewMessage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const gladys = {
},
event: {
emit: fake.returns(null),
on: fake.resolves(null),
},
};

Expand Down
3 changes: 3 additions & 0 deletions server/test/services/mqtt/lib/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const MqttHandler = require('../../../../services/mqtt/lib');
describe('mqttHandler.init', () => {
it('should init', async () => {
const gladys = {
event: {
on: fake.resolves(null),
},
variable: {
getValue: fake.resolves('value'),
},
Expand Down
1 change: 1 addition & 0 deletions server/test/services/mqtt/lib/installContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe('mqttHandler.installContainer', () => {
const gladys = {
event: {
emit: fake.resolves(true),
on: fake.resolves(null),
},
system: {
getNetworkMode: fake.rejects(error),
Expand Down
1 change: 1 addition & 0 deletions server/test/services/mqtt/lib/publish.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const gladys = {
},
event: {
emit: fake.returns(null),
on: fake.resolves(null),
},
};

Expand Down
3 changes: 3 additions & 0 deletions server/test/services/mqtt/lib/saveConfiguration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ describe('mqttHandler.saveConfiguration', () => {
setValue: fake.resolves('value'),
getValue: fake.resolves(true),
},
event: {
on: fake.resolves(null),
},
};

const config = {
Expand Down
1 change: 1 addition & 0 deletions server/test/services/mqtt/lib/setValue.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const gladys = {
},
event: {
emit: fake.returns(null),
on: fake.resolves(null),
},
};

Expand Down
1 change: 1 addition & 0 deletions server/test/services/mqtt/lib/unsubscribe.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const gladys = {
},
event: {
emit: fake.returns(null),
on: fake.resolves(null),
},
};

Expand Down
3 changes: 3 additions & 0 deletions server/test/services/mqtt/lib/updateContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const MqttHandler = proxyquire('../../../../services/mqtt/lib', {
});

const gladys = {
event: {
on: fake.resolves(null),
},
variable: {
setValue: fake.resolves(null),
},
Expand Down

0 comments on commit fe02eac

Please sign in to comment.