@enjin-io/snap
Version:
MetaMask snap for interacting with Enjin dApps
21 lines (17 loc) • 532 B
text/typescript
import sinon from 'sinon';
import type { Wallet } from '../../src/interfaces';
export class WalletMock implements Wallet {
public registerRpcMessageHandler = sinon.stub();
public send = sinon.stub();
public request = sinon.stub();
public reset(): void {
this.registerRpcMessageHandler.reset();
this.send.reset();
this.request.reset();
}
}
export const getWalletMock = (): WalletMock => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return global.snap as WalletMock;
};