diff --git a/packages/keyring-eth-ledger-bridge/src/ledger-mobile-bridge.test.ts b/packages/keyring-eth-ledger-bridge/src/ledger-mobile-bridge.test.ts index a316c1b..71a3d4d 100644 --- a/packages/keyring-eth-ledger-bridge/src/ledger-mobile-bridge.test.ts +++ b/packages/keyring-eth-ledger-bridge/src/ledger-mobile-bridge.test.ts @@ -1,10 +1,15 @@ import ledgerService from '@ledgerhq/hw-app-eth/lib/services/ledger'; +import type { DeviceModel } from "@ledgerhq/devices"; import Transport from '@ledgerhq/hw-transport'; import { MetaMaskLedgerHwAppEth } from './ledger-hw-app'; import { LedgerMobileBridge } from './ledger-mobile-bridge'; import { LedgerTransportMiddleware } from './ledger-transport-middleware'; +type MockDeviceModel = { + id: string, +}; + const DEVICE_ID = 'DEVICE_ID'; describe('LedgerMobileBridge', function () { @@ -25,7 +30,7 @@ describe('LedgerMobileBridge', function () { }; const mockTransport = { - deviceModel: {} || null, + deviceModel: { id: '' } as MockDeviceModel, // Will be set by `beforeEach` send: jest.fn(), close: jest.fn(), decorateAppAPIMethods: jest.fn(), @@ -220,8 +225,8 @@ describe('LedgerMobileBridge', function () { ); }); - it('throws error when transport.deviceMode is not set', async function () { - mockTransport.deviceModel = null; + it('throws error when transport.deviceModel is not set', async function () { + mockTransport.deviceModel = null as unknown as MockDeviceModel; await expect( bridge.updateTransportMethod(mockTransport as unknown as Transport), ).rejects.toThrow( diff --git a/packages/keyring-snap-bridge/src/SnapKeyring.test.ts b/packages/keyring-snap-bridge/src/SnapKeyring.test.ts index 105f652..57fb9da 100644 --- a/packages/keyring-snap-bridge/src/SnapKeyring.test.ts +++ b/packages/keyring-snap-bridge/src/SnapKeyring.test.ts @@ -394,7 +394,7 @@ describe('SnapKeyring', () => { it('fails when the EthMethod is not supported after update', async () => { // Update first account to remove `EthMethod.PersonalSign` - let updatedMethods = Object.values(EthMethod).filter( + let updatedMethods: EthMethod[] = Object.values(EthMethod).filter( (method) => method !== EthMethod.PersonalSign, ); expect(