New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs about using Hardhat with jest #595
Comments
Oh, wow! I had no idea that jest was THAT popular. Thanks for creating this issue and taking the time to analyze how to use it with Buidler. |
Hi @adrianmcli, any updates for us? |
@BnWng I've been swamped lately since I started at UMA. That being said, I have a side project idea that I might try next weekend and I'll be using Jest w/ Buidler. Hopefully I'll have something to show for it by then! |
@BnWng I made some Jest matchers for Waffle to test: TrueFiEng/Waffle#321 Would be cool to get your input. I have a feeling it still needs a lot of work though. I'm curious about how people use Buidler with Jest. That could help inform how to write a guide for Buidler. |
Looks great @adrianmcli . However, I'm now using mocha and chai for my current project. But it looks like you've recreated all the crucial functionality with the chai matchers (which was why I switched away from Jest). I'll make sure to try it out with Jest when I get around to it. Thanks! |
I have started building a Jest plugin for Hardhat: The most basic use-case does work, meaning you can run If anyone wants to help, it's greatly appreciated. |
Hi there I would like to reopen this issue (sorry) |
Yeah, it's definitely possible, If you want to use Jest in your Hardhat projects, I've developed a Hardhat plugin called Hope that it will help you, and I also appreciate your feedback, contributions, and help if you'd like to. Thanks. |
Hey Ryan Will give this a go. Thank you! |
@RyanHosseini Thank you for the package recommendation. Works like a charm 👍 I have a question though. Does Hardhat coverage only show coverage on the solidity files? |
@yannickrocks I'm so glad it was helpful for you! 😃 Don't forget to star the repo as well 😇 Unfortunately, Hardhat coverage uses Pleaes let me know if there's any other thing that I can help you. |
@RyanHosseini Thanks and will do 😄 Do you know how many workers are used in the Issue I was having were tests were passing locally but failing on a github pipeline. Seems like the deploy scripts would struggle to initialise contracts and would throw a VM Exception error. Is it recommended to use the snapshot functionality for the tests? |
Buidler is a great framework, but it lacks official support or documentation for Jest. I've talked about this with @alcuadrado before and he agrees that maybe a guide would be helpful, so I created this issue to track this.
Note that Jest is by far the most popular framework, but most of the crypto world is not aware. My theory is because most crypto people are from the backend world. And Jest is largely a frontend-driven phenomenon:
Source: https://npmcharts.com/compare/mocha,jest,chai
I will try to take some time to experiment with different setups and report back here.
The text was updated successfully, but these errors were encountered: