November 2018
Intermediate to advanced
528 pages
13h 21m
English
As we mentioned before, Truffle enables us to run unit tests using Solidity as well as JavaScript. In order to start testing with Solidity, create a file called TontineTest.sol (.sol extension not .js) in Truffle’s test/ folder with the following code:
import "truffle/Assert.sol"; import "../contracts/tontine.sol"; import "truffle/DeployedAddresses.sol"; contract TontineTest { }This is an empty test contract, so we start by importing the needed testing libraries, DeployedAddresses.sol and Assert.sol (created dynamically at the time of deployment), along with the contract being tested (tontine.sol).
Read now
Unlock full access