Skip to content

Commit

Permalink
Adjusted test
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 authored and rzr committed Jul 26, 2023
1 parent bb10b91 commit dc13ae9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/noble.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1508,25 +1508,26 @@ describe('noble', () => {
});
});

it('onMtu - should update peripheral mtu', () => {
it('onMtu - should update peripheral mtu when set before already', () => {
const peripheral = {
mtu: 'nan'
mtu: 234
};

noble._peripherals = { uuid: peripheral };
noble.onMtu('uuid', 'mtu');
noble.onMtu('uuid', 123);

should(peripheral).deepEqual({ mtu: 'mtu' });
should(peripheral).deepEqual({ mtu: 123 });
});

it('onMtu - should not update peripheral mtu', () => {
it('onMtu - should update peripheral mtu too when empty', () => {
const peripheral = {
mtu: null
};

noble._peripherals = { uuid: peripheral };
noble.onMtu('uuid', 'mtu');
noble.onMtu('uuid', 123);

should(peripheral).deepEqual({ });
should(peripheral).deepEqual({ mtu: 123 });
});

describe('onIncludedServicesDiscover', () => {
Expand Down

0 comments on commit dc13ae9

Please sign in to comment.