Hi guys,
I’m stuck with this damn error, anyone solved this issue?,
I’m confidence that the code 100% is the same as Mosh taught.
Test Suites: 3 failed, 2 passed, 5 total
Tests: 3 failed, 25 passed, 28 total
Snapshots: 0 total
Time: 3.812 s
Ran all test suites.
Error number 1:
● /api/genres › GET / › should return all genres
listen EADDRINUSE: address already in use :::3000
10 |
11 | const port = process.env.PORT || 3000;
> 12 | const server = app.listen(port, () => winston.info(`Listening on port ${port}...`));
| ^
13 |
14 | module.exports = server;
at Function.listen (node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (index.js:12:20)
at Object.<anonymous> (tests/integration/genres.test.js:9:33)
× should return 401 if client is not logged in (855 ms)
Error number 2:
● /api/returns › should return 401 if client is not logged in
listen EADDRINUSE: address already in use :::3000
10 |
11 | const port = process.env.PORT || 3000;
> 12 | const server = app.listen(port, () => winston.info(`Listening on port ${port}...`));
| ^
13 |
14 | module.exports = server;
at Function.listen (node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (index.js:12:20)
at Object.<anonymous> (tests/integration/returns.test.js:12:18)
Error number 3:
● auth middleware › should return 401 if no token is provided
listen EADDRINUSE: address already in use :::3000
10 |
11 | const port = process.env.PORT || 3000;
> 12 | const server = app.listen(port, () => winston.info(`Listening on port ${port}...`));
| ^
13 |
14 | module.exports = server;
at Function.listen (node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (index.js:12:20)
at Object.<anonymous> (tests/integration/auth.test.js:8:33)