Skip to content

Commit

Permalink
Switch to non-WebUSB API, add disconnection event support
Browse files Browse the repository at this point in the history
Signed-off-by: Liam McLoughlin <lmcloughlin@google.com>
  • Loading branch information
Hexxeh committed Oct 18, 2022
1 parent bc116fb commit dc5071b
Show file tree
Hide file tree
Showing 4 changed files with 333 additions and 206 deletions.
2 changes: 1 addition & 1 deletion packages/sdk-cli/src/commands/connect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe.each<[DeviceType, HostType]>([
});

it('logs a message when the host disconnects', () => {
mockStream.emit('finish');
mockStream.emit('close');
expect(mockLog.mock.calls[1]).toMatchSnapshot();
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-cli/src/commands/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const connectAction = async (
}

const connection = await hostConnections.connect(host, deviceType);
connection.stream.once('finish', () =>
connection.stream.once('close', () =>
cli.log(`${startCase(deviceType)} '${host.displayName}' disconnected`),
);

Expand Down
Loading

0 comments on commit dc5071b

Please sign in to comment.