@onekeyfe/hd-transport-web-device 1.2.8-alpha.100 → 1.2.8-alpha.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -561,9 +561,9 @@ describe('ElectronBleTransport protocol detection', () => {
561
561
 
562
562
  const transport = configureTransport(nobleBle);
563
563
 
564
- await expect(transport.acquire({ uuid: device.id })).rejects.toThrow(
565
- /Unable to detect BLE protocol/
566
- );
564
+ await expect(transport.acquire({ uuid: device.id })).rejects.toMatchObject({
565
+ errorCode: HardwareErrorCode.TransportProtocolProbeFailed,
566
+ });
567
567
  expect(nobleBle.unsubscribe).toHaveBeenCalledWith(device.id);
568
568
  expect(nobleBle.disconnect).toHaveBeenCalledWith(device.id);
569
569
  expect(transport.getProtocolType(device.id)).toBeUndefined();
@@ -629,7 +629,8 @@ describe('ElectronBleTransport protocol detection', () => {
629
629
  await expect(
630
630
  transport.acquire({ uuid: device.id, expectedProtocol: 'V2' })
631
631
  ).rejects.toMatchObject({
632
- errorCode: HardwareErrorCode.RuntimeError,
632
+ errorCode: HardwareErrorCode.TransportProtocolProbeFailed,
633
+ params: { expectedProtocol: 'V2' },
633
634
  });
634
635
 
635
636
  expect(nobleBle.connect).toHaveBeenCalledTimes(1);
@@ -645,12 +646,14 @@ describe('ElectronBleTransport protocol detection', () => {
645
646
  await expect(
646
647
  transport.acquire({ uuid: device.id, expectedProtocol: 'V2' })
647
648
  ).rejects.toMatchObject({
648
- errorCode: HardwareErrorCode.RuntimeError,
649
+ errorCode: HardwareErrorCode.TransportProtocolProbeFailed,
650
+ params: { expectedProtocol: 'V2' },
649
651
  });
650
652
  await expect(
651
653
  transport.acquire({ uuid: device.id, expectedProtocol: 'V2' })
652
654
  ).rejects.toMatchObject({
653
- errorCode: HardwareErrorCode.RuntimeError,
655
+ errorCode: HardwareErrorCode.TransportProtocolProbeFailed,
656
+ params: { expectedProtocol: 'V2' },
654
657
  });
655
658
 
656
659
  expect(transport.getProtocolType(device.id)).toBeUndefined();
@@ -755,7 +758,8 @@ describe('ElectronBleTransport protocol detection', () => {
755
758
  await expect(
756
759
  transport.acquire({ uuid: device.id, expectedProtocol: 'V2' })
757
760
  ).rejects.toMatchObject({
758
- errorCode: HardwareErrorCode.RuntimeError,
761
+ errorCode: HardwareErrorCode.TransportProtocolProbeFailed,
762
+ params: { expectedProtocol: 'V2' },
759
763
  });
760
764
 
761
765
  expect(nobleBle.unsubscribe).toHaveBeenCalledWith(device.id);