Skip to content

Commit 3f82908

Browse files
authored
Update part5d.md
although the testing router is discussed here and as a referral branch 5-1 is given however the branch does not include this relevant code or testing router I have opened another pull request and added the relevant changes to branch 5-1
1 parent 5fb3659 commit 3f82908

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content/5/en/part5d.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,18 +416,18 @@ We can empty the database using these endpoints.
416416
Let's create a new <i>router</i> for the tests
417417

418418
```js
419-
const router = require('express').Router()
419+
const testingRouter = require('express').Router()
420420
const Note = require('../models/note')
421421
const User = require('../models/user')
422422

423-
router.post('/reset', async (request, response) => {
423+
testingRouter.post('/reset', async (request, response) => {
424424
await Note.deleteMany({})
425425
await User.deleteMany({})
426426

427427
response.status(204).end()
428428
})
429429

430-
module.exports = router
430+
module.exports = testingRouter
431431
```
432432

433433
and add it to the backend only <i>if the application is run on test-mode</i>:

0 commit comments

Comments
 (0)