Closed pacelliv closed 1 year ago
Awesome work!!
To keep the code minimal here, I'm going to close the pull request, but doing this extra credit will hone your skills to get better at writing tests. Great work!
Thank you and I understand, I also thought I made a lot changes but it was worth trying.
I have a question, in the dynamicSvg
test file there is a comment that says "Maybe some tokenURI oddities", I thought about that but I couldn't think of any. The only thing I test was switching the tokenURI
based on the highValue
paid by the minter calling the updateAnswer
method from the Aggregator, but I don't think this counts as an oddity.
Could you give me ideas about a few oddities so can try to test them?
We could be more explicit with checking that the tokenURIs are being correctly formatted even with weird data or weird SVGs.
It's not crazy important tho. A fuzz test would be nice here (but... I didn't cover those in the course)
A recap of the changes I made:
A. In the case of the
dynamicSvg.test.js
:utils
folder namedcreateUris.js
, this file contains acreateImageUri
and acreateTokenUri
function to create images and tokens URIs, respectively with Ethersjs. In this way we can test the functions of the contract. Also, I included comments in the file.B. In the case of the
randomIpfs.test.js
:withdraw
function.console.log
in the test of thefulfillRandomWords
.