Getting Started

Hydra is an EOSIO smart contract testing framework that allows you to quickly get started with testing your smart contract code. Besides Hydra, installing additional software or running your own local blockchain node is not required.

Quick Start#


Hydra is a Node.js library, so make sure Node.js/NPM is installed.

npm i -g @klevoya/hydra

Log in to your existing Klevoya account or sign up by running the login command and following the instructions:

hydra login

Writing tests#

Hydra tests are written in JavaScript/TypeScript using a JavaScript testing library of your choice.

Navigate to your contract project's root folder and compile your smart contract. After that, run the hydra init command selecting the contracts you want to test. It will initialize an NPM project and set up a JavaScript testing library (jest).

cd eos-project
hydra init

The init command also bootstraps your project by creating a hydra.yml configuration file and a test boilerplate in the tests directory. Then run your tests:

npm test