Skip to content

Commit 304386c

Browse files
committed
Finish all intro section and outro text + clean up
1 parent 5d88b16 commit 304386c

File tree

1 file changed

+33
-32
lines changed
  • pages/lessons/projects

1 file changed

+33
-32
lines changed

pages/lessons/projects/4.mdx

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ import { LessonHeader } from '../../../components/mdx/LessonHeader'
1414

1515
## About this lesson
1616

17-
Welcome to this lesson where we’ll be adding automated tests for our *TierNFT* smart contract created in the previous tutorial. If you haven’t completed it already, we have a fast-track guide below to that project set-up - assuming you’re already confident with Solidity and a professional development environment. If not, we’d recommend completing the earlier tutorials in this track.
17+
Welcome to this lesson where we’ll be adding automated tests for our *TierNFT* smart contract created in the previous tutorial. In case you haven’t completed it already, we have a fast-track guide below to that project set-up - assuming you’re confident with Solidity and a professional development environment. If you're not, we’d recommend completing the tutorials in this track before this one, before moving on to *Connecting your TierNFT Smart Contract to a Frontend*, our project series finalé.
1818

19-
Over here, you’ll learn about the benefits of writing automated tests, general testing concepts and best practices. You’ll walk away with many practical tests for smart contracts and nibble on some food for thought about test-driven development.
19+
Back here, you’ll learn about the benefits of writing automated tests, general testing concepts and best practices. You’ll walk away with many practical tests for smart contracts and nibble on some food for thought about test-driven development.
2020

21-
As you dive in to the lesson, you'll come across some thought-provoking checkpoint questions designed to test your existing knowledge, measure how well you're absorbing the fresh content, and maybe ask you to predict next steps in the lesson. And to wrap up, a final quiz awaits. To complete this adventure might take anywhere from one to six hours. That all depends on your previous experience and how much new ground you need to cover. But enjoy the journey and remember to take regular breaks along the way. We care about your well-being and have even included a nifty pomodoro timer ⌛ in the menu header. Let it remind you to appreciate nature's gifts and "go touch some grass" for a while. 🌱 Embrace the process, and let's set sail!
21+
As you dive in to the lesson, you'll come across some thought-provoking checkpoint questions designed to test your existing knowledge, measure how well you're absorbing the fresh content, and we might even ask you to predict next steps in the lesson. And to wrap up, a final quiz awaits. To complete this adventure might take anywhere from one to four hours. That all depends on your previous experience and how much new ground you need to cover. But enjoy the journey and remember to take regular breaks along the way. We care about your well-being and have even included a nifty pomodoro timer ⌛ in the menu header. Let it remind you to appreciate nature's gifts and "go touch some grass" for a while. 🌱 Embrace the process.
22+
23+
Let's raise the sails to catch the wind of what's to come:
2224

2325
<SideDrawer buttonText="Warm-up Questions" title="Check out Your Previous Knowledge">
2426
<Question question="lesson-4/1-intro/Q1" />
@@ -28,8 +30,7 @@ As you dive in to the lesson, you'll come across some thought-provoking checkpoi
2830
<Question question="lesson-4/1-intro/Q5" />
2931
</SideDrawer>
3032

31-
PART 1
32-
33+
And set sail . . .
3334

3435
## Why automated testing?
3536

@@ -44,29 +45,31 @@ Testing can:
4445
- give you a safety net when you make improvements to the code later
4546

4647
Tests are a tool for writing your code and making sure it keeps working as
47-
expected when changes are made.
48-
49-
Automated tests don't fully replace manually testing your smart contract but
48+
expected when changes are made. Automated tests don't fully replace manually testing your smart contract but
5049
it's an important tool to ensuring your contract will work as expected.
5150

52-
## Let's Get Started
5351

54-
### Setting up our project dependencies
52+
### Quick breakdown of lesson steps
53+
- Set up our local development environment
54+
- Write unit tests
55+
- Test NFT contract initialisation, mint and withdrawl functions
56+
- Refactor tokenURI() function and test new helper methods:
57+
- Summary: understanding the concept of Test-Driven Development (TDD)
5558

56-
If you have an existing project from your previous work on the TierNFT lesson,
57-
you have all the Hardhat dependencies installed.
59+
### Developer tools and libraries we'll be using
60+
- Hardhat development environment
61+
- Mocha JavaScript framework for writing units tests
62+
- Chai, an assertion library compatible with Mocha
63+
- OpenZeppelin libraries will help bring clarity to testing our contract
5864

59-
Otherwise let's create a new Hardhat project and copy in the contract which
60-
we'll be testing.
65+
## Let's Get Started
6166

62-
To create a new project, please refer to _Lesson 3 - Tier NFTs_ and search for
67+
### Setting up our project dependencies
68+
If you have an existing project from your previous work on the TierNFT lesson,
69+
you have all the Hardhat dependencies installed. {/* @wolovim , would we need to comment out the deployment script if we were to use that 'already set up' project? I mean, would that script give us bother each time we ran the tests in this lesson? */} Otherwise let's create a new Hardhat project and copy in the contract which
70+
we'll be testing. To create a new project, please refer to _Lesson 3 - Tier NFTs_ and search for
6371
the “First things first 👷‍♂️" section to get your project going. Follow the steps
64-
until "Let’s start coding”, then open up your code editor.
65-
66-
67-
_If you are using VSCode, type `code .` in your terminal to open VSCode._
68-
69-
After running through that section you'll have a working Hardhat project for the
72+
until "Let’s start coding”, then open up your code editor. If you are using VSCode, type `code .` in your terminal to open VSCode. After running through that section you'll have a working Hardhat project for the
7073
next steps.
7174

7275
### Add test command for running tests
@@ -216,7 +219,7 @@ module.exports = {
216219
<Question question="lesson-4/2-get-set-up/Q4" />
217220
<Question question="lesson-4/2-get-set-up/Q5" />
218221
</SideDrawer>
219-
PART 2
222+
⌛ Pomodoro? 😊 🌱
220223

221224
## What do we want to test on our TierNFT contract?
222225

@@ -423,7 +426,6 @@ failure looks like:
423426
<Question question="lesson-4/3-general-concepts/Q5" />
424427
</SideDrawer>
425428

426-
PART 3
427429

428430
### Let's add tests for mint()
429431

@@ -609,8 +611,8 @@ of additional highlights:
609611
<Question question="lesson-4/4-mint-withdraw/Q4" />
610612
<Question question="lesson-4/4-mint-withdraw/Q5" />
611613
</SideDrawer>
614+
⌛ Pomodoro? 😊 🌱
612615

613-
PART 4
614616

615617
### Testing tokenURI()
616618

@@ -905,16 +907,13 @@ fail when code changes.
905907
<Question question="lesson-4/5-SVG-test/Q5" />
906908
</SideDrawer>
907909

908-
OUTRO
909910

910911
## Food for Thought
911912

912913
With all the helpfulness of tests, why didn't we start with them before we wrote
913-
any of the contract implementation?
914-
915-
The main reason was trying to minimize all the things you needed to learn to get
914+
any of the contract implementation? The main reason was trying to minimize all the things you needed to learn to get
916915
started, but the methodology of writing tests first is called "Test Driven
917-
Development" (TDD).
916+
Development" (TDD).
918917

919918
TDD is a very powerful methodology which goes like this:
920919

@@ -938,21 +937,23 @@ With TDD:
938937
version that outputs a long base64 string because it's not testable.
939938

940939
Bolting on tests after the fact can be painful and boring, and you lose the
941-
potential code improvements you can make when you test as you go.
940+
potential code improvements you can make when you test as you go. And speaking of testing as you go, why not take the quiz 😊
942941

943942
<br/><br/>
944943
<Quiz quiz="lesson-4-quiz" />
945944
<br/><br/>
946945

946+
You just did some amazing work, and you will do a great service to the web3 ecosystem by being conscious of the value of writing solid code. There’s lots more to explore in Academy, and we’re looking forward to seeing you in our final project in this ERC721 track where you’ll be *Connecting your TierNFT Smart Contract to a Frontend*. Why not dive into the forum in the mean time, and share your new found wisdom with our community.
947+
947948
Go forth, test, and prosper knowing you have confidence in the code you're
948949
deploying into the world.
949950

950951
import { ContributorFooter } from '../../../components/mdx/ContributorFooter'
951952

952953

953954
<ContributorFooter
954-
authors={['brianfive']}
955-
reviewers={['piablo', 'georgemac510']}
955+
authors={['brianfive', 'piablo']}
956+
reviewers={['georgemac510', 'wolovim']}
956957
contributors={[]}
957958
/>
958959

0 commit comments

Comments
 (0)