Testing and debugging a Convector Smart Contract

Walter Montes
Mar 21 · 5 min read

Unit tests

What are Unit Tests

Some advantages of implementing Unit Tests

How to do it

$ npm i -g @worldsibu/convector-cli
$ conv new bughunting -c mybuggychaincode$ cd bughunting$ npm install

Testing

Expected test result
$ npm test

Debugging

Debugging Unit Test

"test": "npm run build && mocha --inspect --debug=8888 -r ts-node/register tests/*.spec.ts --reporter spec"
Debugging code.

Debugging code in the blockchain

$ npm run cc:start:debug — mybuggychaincode
# It will throw an expected error - This will take some seconds while downloading dependencies again in the rest of the organizations
$ hurl invoke mybuggychaincode init

WorldSibu

A unified development platform to create and deploy enterprise smart contract systems.

Thanks to Diego Barahona.

Walter Montes

Written by

CEO @WorldSibu — https://worldsibu.tech/forma

WorldSibu

WorldSibu

A unified development platform to create and deploy enterprise smart contract systems.