Skip to content

Commit d07bed7

Browse files
committed
Add 4 questions to fourth mini-quiz
1 parent b66678f commit d07bed7

File tree

5 files changed

+22
-44
lines changed

5 files changed

+22
-44
lines changed

pages/lessons/projects/4.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ additional comment line I added that says
457457
})
458458
```
459459

460-
Our new `describe` section show below will replace that line that says
460+
Our new `describe` section shown below will replace that line that says
461461
`// this is where existing describe section ends`.
462462

463463
<Callout emoji="💡" size="md" variant="info">
@@ -527,7 +527,7 @@ the proper amount of Eth is not provided. This happens here:
527527
```javascript
528528
await expect(
529529
contract.mint({
530-
value: hre.ethers.utils.parseEther('0.001'),
530+
value: hre.ethers.parseEther('0.001'),
531531
}),
532532
).to.be.revertedWith('Not enough value for the minimum Tier')
533533
```
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
{
2-
"question": "",
2+
"question": "Syntax errors: is your final '})' syntax matching the opening 'describe('TierNFT', function () {' every time you add new tests?",
33
"options": [
44
{
5-
"answer": "",
5+
"answer": "Yes",
66
"correct": true
77
},
88
{
9-
"answer": ""
10-
},
11-
{
12-
"answer": "",
13-
"correct": true
14-
},
15-
{
16-
"answer": ""
17-
},
18-
{
19-
"answer": ""
9+
"answer": "No? It's easy to run into errors with the smallest things. We all do it. Take your time to read the error messages."
2010
}
2111
]
2212
}
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{
2-
"question": "",
2+
"question": "In the contract, we often use the 'require' statement to enforce certain conditions. In our tests, which Chai function helps us verify if the contract indeed throws an error when a condition is not met?",
33
"options": [
44
{
5-
"answer": "",
6-
"correct": true
5+
"answer": "expectError"
76
},
87
{
9-
"answer": ""
8+
"answer": "expectThrow"
109
},
1110
{
12-
"answer": "",
13-
"correct": true
11+
"answer": "expectFailure"
1412
},
1513
{
16-
"answer": ""
17-
},
18-
{
19-
"answer": ""
14+
"answer": "revertedWith",
15+
"correct": true
2016
}
2117
]
2218
}
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{
2-
"question": "",
2+
"question": "When using 'expect()' with the 'to.equal()' function, what does the argument passed to 'to.equal()' refer to?",
33
"options": [
44
{
5-
"answer": "",
6-
"correct": true
5+
"answer": "The expected output of the test case."
76
},
87
{
9-
"answer": ""
8+
"answer": "The contract function being tested."
109
},
1110
{
12-
"answer": "",
13-
"correct": true
11+
"answer": "The result obtained from an asynchronous operation."
1412
},
1513
{
16-
"answer": ""
17-
},
18-
{
19-
"answer": ""
14+
"answer": "The value returned by an assertion or condition.",
15+
"correct": true
2016
}
2117
]
2218
}
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{
2-
"question": "",
2+
"question": "In the 'withdraw()' tests, why is the line 'await contract.connect(otherUser).withdraw()' used?",
33
"options": [
44
{
5-
"answer": "",
6-
"correct": true
7-
},
8-
{
9-
"answer": ""
5+
"answer": "To ensure the contract owner can withdraw the entire contract balance."
106
},
117
{
12-
"answer": "",
8+
"answer": "To verify that the 'withdraw()' function updates the contract balance correctly.",
139
"correct": true
1410
},
1511
{
16-
"answer": ""
12+
"answer": "To check if the contract is functioning correctly for non-owner users."
1713
},
1814
{
19-
"answer": ""
15+
"answer": "To confirm the contract has sufficient funds before withdrawing."
2016
}
2117
]
2218
}

0 commit comments

Comments
 (0)