Truffle provides a solid test framework, which allows you to write test cases in both JavaScript and Solidity. Tests in a Truffle project should exist in the ./test directory. Tests can have either a .js or .sol extension, based on the language they are written in. In this recipe, you will learn to write test cases for your smart contract in both JavaScript and Solidity.
Writing tests for smart contracts
Getting ready
You need to have Truffle installed on your machine to step through this recipe. You also need to have a working Ethereum network to enable Truffle to run tests on the contracts.