Hello.
I’m trying to follow the course GitHub Workflows but on the CI part when I’m trying to run de npm run coverage a receive this:
npm run coverage
> Solar [email protected] coverage
> nyc --reporter cobertura --reporter lcov --reporter text --reporter json-summary mocha app-test.js --timeout 10000 --exit
Server successfully running on port - 3000
Planets API Suite
Fetching Planet Details
1) it should fetch a planet named Mercury
2) it should fetch a planet named Venus
3) it should fetch a planet named Earth
4) it should fetch a planet named Mars
5) it should fetch a planet named Jupiter
6) it should fetch a planet named Satrun
7) it should fetch a planet named Uranus
8) it should fetch a planet named Neptune
Testing Other Endpoints
it should fetch OS Details
✔ it should fetch OS details
it should fetch Live Status
✔ it checks Liveness endpoint
it should fetch Ready Status
✔ it checks Readiness endpoint
3 passing (792ms)
8 failing
1) Planets API Suite
Fetching Planet Details
it should fetch a planet named Mercury:
Uncaught AssertionError: expected {} to have property 'id'
at /home/sergi/DevOpsProjects/cicd/githubactions/kodekloud-course/resources/solar-system/app-test.js:23:42
at Request.callback (node_modules/superagent/lib/node/index.js:857:12)
at IncomingMessage.<anonymous> (node_modules/superagent/lib/node/index.js:1070:18)
at IncomingMessage.emit (node:events:529:35)
at endReadableNT (node:internal/streams/readable:1400:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
The version of node is 18.20.0 and npm 10.8.2
The npm test runs ok without errors.
I create a database on mongo atlas with the database and import the planets db.
Thanks for advance