Skip to Main Content
Truffle Quick Start Guide
book

Truffle Quick Start Guide

by Nikhil Bhaskar
June 2018
Beginner to intermediate content levelBeginner to intermediate
170 pages
3h 46m
English
Packt Publishing
Content preview from Truffle Quick Start Guide

Testing the TaskMaster 

Under the test folder, you should already see two test files, one in JavaScript and one in Solidity. These were the files that came out of the box when we initialized our Truffle project. Since we have a TaskMaster contract and not a MetaCoin contract, feel free to delete those two test files. Let's start from scratch.

Your test folder should now be empty.

Now, inside the test folder, create a new file called TestTaskMaster.sol

It is good practice to prefix your Solidity test files with Test before the name of the contract you are testing. So, if you are testing a contract called TaskMaster, it is good practice to name your test contract TestTaskMaster.

Start by adding a few necessary Truffle imports, including ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cryptosocial

Cryptosocial

Allen Taylor
Step into the Metaverse

Step into the Metaverse

Mark van Rijmenam

Publisher Resources

ISBN: 9781789132540Supplemental Content