In this assignment, you will write unit and functional testing scripts in TypeScript. A complete Solidity contract will be given to you.
As with all assignments, don’t hesitate to Google, but do not copy verbatim or directly from your peers. Your code must compile and run to receive any credit.
Submission guidelines: Push frequently to your GitHub Classroom repository before due.
GitHub Classroom invite for HW5: https://classroom.github.com/a/wyzVCBlE
Deadline: Nov 15, 2022 16:00 PST
The given smart contract, ComeFundMe, is a fundraising platform on Ethereum. Anyone can start a new campaign and others can donate to it. The donated funds cannot be refunded. The initiator of the campaign can end the campaign and collect raised funds at any time.
test
, give it a relevant name and make sure it ends with .test.ts
.You must write at least 2 unit tests for every single Solidity function. Make sure you clearly group them by using describe
.
You must write 2 sets of functional tests. One test that walks through a fundraising process normally, the other test where you try to perform actions that shouldn’t be allowed and check if the smart contract stops you. At least 2 reverts should be triggered and caught.