Unit tests for Telos smart contracts
- Smart contract Telos
What is the best way to implement and run unit tests for Telos/EOSIO smart contracts? Is there a way to run unit tests without a need to run local Telos node?
There are two types of tests that can be written for your smart contracts code
- Unit tests
- Integration tests
Unit tests for EOSIO smart contracts can be implemented using Boost. You can see an example here, in official EOSIO repository - https://github.com/EOSIO/eosio.contracts/tree/master/tests
Integration tests will require some version of running EOSIO node. At Peeranha we are using EOSIO running in docker container locally. We add debug actions to the contracts that allow to clean data in all of the tables between the test. Then we write our tests in Python using unittest library.