Skip to content

Commit 81694ab

Browse files
committed
Clarify where new "describe" blocks go
1 parent c662b34 commit 81694ab

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

lessons/projects/4.mdx

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ describe('TierNFT', function () {
270270
<ContentCallout emoji="💡" size="md" variant="info">
271271
Before we walk through, let's make sure everything is working correctly. Run
272272
the tests using `npm test` and you should see these two initial tests pass.
273-
<strong>This is an important milestone! You created your first tests and they now pass.<strong>
273+
**This is an important milestone! You created your first tests and they now
274+
pass.**
274275
</ContentCallout>
275276

276277
Now let's walk through the test code we've pasted in and explain what it does.
@@ -393,12 +394,38 @@ failure looks like:
393394

394395
### Let's add tests for mint()
395396

396-
Here are tests we'll be adding:
397+
Now is time to add tests for our `mint()` method. We'll group these new tests
398+
into a new `describe` section.
399+
400+
Where exactly do we add this `describe` block?
401+
402+
Currently the end of our `tier-nft.test.js` looks like this, with just one
403+
additional comment line I added that says
404+
`// this is where existing describe section ends`:
405+
406+
```javascript
407+
describe('constructor', async () => {
408+
it('set proper collection name', async function () {
409+
const name = await contract.name()
410+
expect(name).to.equal('TierNFT')
411+
})
412+
413+
it('set proper collection symbol', async function () {
414+
const symbol = await contract.symbol()
415+
expect(symbol).to.equal('Tier')
416+
})
417+
})
418+
// this is where existing describe section ends
419+
})
420+
```
421+
422+
Our new `describe` section show below will replace that line that says
423+
`// this is where existing describe section ends`.
397424

398425
<ContentCallout emoji="💡" size="md" variant="info">
399-
In the next sections we'll be continuing to add groups of tests in new `describe` sections.
400-
Where do these go in the file? You have an existing section that starts with `describe('constructor', async () => {`.
401-
Ensure you paste the future `describe` sections immediately after where that previous section ends.
426+
Make sure you keep that last line `})` which is the very end of the block of
427+
code that holds **all** of the `describe` blocks you're adding in this whole
428+
lesson.
402429
</ContentCallout>
403430

404431
```javascript

0 commit comments

Comments
 (0)