Tryorama provides a convenient way to run an arbitrary amount of Holochain conductors on your local machine, as well as on network nodes that are running the TryCP service. In combination with the test runner and assertion library of your choice, you can test the behavior of multiple Holochain nodes in a network. Included functions to clean up used resources make sure that all state is deleted between tests so that they are independent of one another.
npm install @holochain/tryorama
Tryorama v0.11.x is compatible with JS client v0.13.x and Holochain v0.1.x.
Tryorama v0.15.x is compatible with JS client v0.16.x and Holochain v0.2.x.
Tryorama v0.16.x is compatible with JS client v0.17.x and Holochain v0.3.x.
With a few lines of code you can start testing your Holochain application. The examples in this repository use tape as test runner and assertion library. You can choose any other runner and library.
Curried function to get a zome caller
Scenario.addPlayerWithHapp as well as
Conductor.installAgentsHapps allow for a
signal handler to be specified. Signal handlers are registered with
the conductor and act as a callback when a signal is received.
The log level can be set with the environment variable
Log levels used in Tryorama are
info. The default
info. To set the log level for a test run, prepend the test command
TRYORAMA_LOG_LEVEL=debug node test.js
Scenarios provide high-level functions to interact with the Holochain Conductor API. Players consist of a conductor, an agent and installed hApps, and can be added to a Scenario. Access to installed hApps is made available through the cells, which can either be destructured according to the sequence during installation or retrieved by their role id.