Skip to Content
Building Ethereum Dapps
book

Building Ethereum Dapps

by Roberto Infante
March 2019
Intermediate to advanced
504 pages
17h
English
Manning Publications
Content preview from Building Ethereum Dapps

Chapter 10. Unit testing contracts with Mocha

This chapter covers
  • Installing and setting up Mocha, a JavaScript unit testing framework
  • Unit testing SimpleCoin with Mocha
  • Writing tests performing negative checks, verifying expected exceptions are thrown
  • Writing tests performing positive checks, verifying logic is executed successfully

In previous chapters, you learned how to develop an Ethereum Dapp by using simple tools that the platform offers. You were able, with some effort, to build an end-to-end Dapp, including a simple web UI and a smart contract layer (including libraries) and to deploy it to the public test network. You wrote Solidity and Web3.js code through Remix or even through plain text editors and launched ...

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

Blockchain Development with Hyperledger

Blockchain Development with Hyperledger

Salman A. Baset, Luc Desrosiers, Nitin Gaur, Petr Novotny
Ethereum For Dummies

Ethereum For Dummies

Michael G. Solomon

Publisher Resources

ISBN: 9781617295157Publisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link