Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
test: fix jest.spyOn of @metamask/eth-sig-util by mocking es module
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Oct 3, 2023
1 parent f5c2c98 commit 36d2ab4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ledger-keyring.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Common, Chain, Hardfork } from '@ethereumjs/common';
import { TransactionFactory } from '@ethereumjs/tx';
import sigUtil from '@metamask/eth-sig-util';
import * as sigUtil from '@metamask/eth-sig-util';
import EthereumTx from 'ethereumjs-tx';
import * as ethUtil from 'ethereumjs-util';
import HDKey from 'hdkey';
Expand All @@ -9,6 +9,14 @@ import { LedgerBridge } from './ledger-bridge';
import { LedgerIframeBridge } from './ledger-iframe-bridge';
import { AccountDetails, LedgerKeyring } from './ledger-keyring';

jest.mock('@metamask/eth-sig-util', () => {
return {
// eslint-disable-next-line @typescript-eslint/naming-convention
__esModule: true,
...jest.requireActual('@metamask/eth-sig-util'),
};
});

const fakeAccounts = [
'0xF30952A1c534CDE7bC471380065726fa8686dfB3',
'0x44fe3Cf56CaF651C4bD34Ae6dbcffa34e9e3b84B',
Expand Down

0 comments on commit 36d2ab4

Please sign in to comment.