-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 Buidler Tutorial for beginners #483
Conversation
Made it easier to follow through with more support for the reader
docs/tutorial/5-test/README.md
Outdated
@@ -1,143 +1,145 @@ | |||
# 5. Testing contracts | |||
|
|||
Smart contracts are normally tested using JavaScript. You develop the contract in Solidity, but use an Ethereum library to have a JavaScript model of your contract and write your tests with it. This saves a lot of time because you don’t have to spend the time manually executing the code yourself. | |||
Writing automated tests when building smart contracts is of crucial importance, as your user's money is what's at stake. For this we're going to use **Buidler EVM**, a local Ethereum network designed for development that is built-in and the default network in **Buidler**. You don't need to setup anything to use it. In our tests we're going to use ethers.js to model and interact with the Ethereum contract we built in the previous section, and [Mocha](https://mochajs.org/) as our test runner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the text should focus on explaining why/how contracts are tested with JavaScript. What about something like:
Writing automated tests when building smart contracts is of crucial importance, as your user's money is what's at stake.
Smart contracts are normally tested using JavaScript. You develop the contract in Solidity, but use an Ethereum library to have a JavaScript model of your contract and write your tests with it. This saves a lot of time because you don't have to spend the time manually executing and signing transactions.
In this tutorial we're going to use Ether.js and Waffle (which uses Mocha under the hood). The tests will be running on Buidler EVM, a local Ethereum network designed for development that is built-in and the default network in Buidler. You don't need to setup anything to use it as we already did.
This adds a new section to the website that works with its own sidebar.