Skip to content

Commit

Permalink
test: adjusted test for new state event from hci socket
Browse files Browse the repository at this point in the history
  • Loading branch information
stoprocent committed Nov 2, 2023
1 parent 0172dd5 commit d967b48
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/lib/hci-socket/hci.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ describe('hci-socket hci', () => {
hci._userChannel = 'userChannel';
hci.init();

assert.callCount(hci._socket.on, 2);
assert.callCount(hci._socket.on, 3);
assert.calledWithMatch(hci._socket.on, 'data', sinon.match.func);
assert.calledWithMatch(hci._socket.on, 'error', sinon.match.func);
assert.calledWithMatch(hci._socket.on, 'state', sinon.match.func);

assert.calledOnceWithExactly(hci._socket.bindUser, deviceId, undefined);
assert.calledOnceWithExactly(hci._socket.start);
Expand All @@ -57,9 +58,10 @@ describe('hci-socket hci', () => {
hci._bound = false;
hci.init();

assert.callCount(hci._socket.on, 2);
assert.callCount(hci._socket.on, 3);
assert.calledWithMatch(hci._socket.on, 'data', sinon.match.func);
assert.calledWithMatch(hci._socket.on, 'error', sinon.match.func);
assert.calledWithMatch(hci._socket.on, 'state', sinon.match.func);

assert.calledOnceWithExactly(hci._socket.bindRaw, deviceId, undefined);
assert.calledOnceWithExactly(hci._socket.start);
Expand All @@ -76,9 +78,10 @@ describe('hci-socket hci', () => {
hci._bound = true;
hci.init();

assert.callCount(hci._socket.on, 2);
assert.callCount(hci._socket.on, 3);
assert.calledWithMatch(hci._socket.on, 'data', sinon.match.func);
assert.calledWithMatch(hci._socket.on, 'error', sinon.match.func);
assert.calledWithMatch(hci._socket.on, 'state', sinon.match.func);

assert.notCalled(hci._socket.bindRaw);
assert.calledOnceWithExactly(hci._socket.start);
Expand Down

0 comments on commit d967b48

Please sign in to comment.