Socket
Socket
Sign inDemoInstall

@zondax/zemu

Package Overview
Dependencies
Maintainers
1
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zondax/zemu

Zemu Testing Framework


Version published
Weekly downloads
3.4K
increased by2.02%
Maintainers
1
Weekly downloads
 
Created
Source

Zemu

License npm version CircleCI CodeFactor

This package is part of our Ledger development and integration testing process. It allows full device/app mocking.

QuickStart:
Zemu class provides access and control to your emulated Ledger app running on a docker container.

Basic testing code:

jest.setTimeout(20000);

test("demo", async () => {
    //Create Zemu object. Pass the path to your .elf file
    const sim = new Zemu("/ledger-demo/app/bin/");
    //Create an instance of your Ledger-js app
  try {
    const demoJSApp = new DemoApp(sim.getTransport());
    //Start simulator. A new docker container instance will be created.
    await sim.start();
    //Do your tests
    ...
    //Finally, close the simulator. This will stop and remove the container.
  } finally {
    await sim.close();
  }
});

Basic control commands examples:

  • Take a screenshot and save it:
    await sim.snapshot("tests/snapshots/0.png")

  • Send "click left":
    await sim.clickLeft()

  • Send "click right":
    await sim.clickRight()

  • Send "click both":
    await sim.clickBoth()

  • Wait some time:
    await Zemu.sleep(500) //Time in [ms]

We recommend using the npmjs package in order to receive updates/fixes.

We appreciate any contributions to this effort!

Keywords

FAQs

Package last updated on 08 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc