@ledgerhq/hw-transport-mocker
Version:
Ledger Hardware Wallet mocker utilities used for tests
22 lines • 838 B
TypeScript
import Transport from "@ledgerhq/hw-transport";
/**
* Builds a fake Transport object to use in tests
*
* Note: no Transport methods are implemented, this is duck typing a Transport to use on unit tests where
* the transport instance does not matter. If a specific value is expected from a method, you can pass the
* fake method implementation to the `props` of the builder.
*
* If you want a working mocked Transport, you should use `MockTransport`.
*
* Ex:
* ```
* aTransportBuilder({
* exchange: jest.fn().mockReturnValue(Buffer.from("Test")),
* }),
* ```
*
* @param props Any value in props will override the default fake value of the same property/method
* @return A duck-typed Transport
*/
export declare const aTransportBuilder: (props?: Partial<Transport>) => Transport;
//# sourceMappingURL=aTransport.d.ts.map