Mocha tests missing in the Expresso capstone project

Hi folks!

I am working on the Expresso project from the web development skill path and I have noticed a problem with the tests to run to check my work.

At first, when I install the starting code the tests run just fine. But after some time suddenly not all of them show up when typing “npm test” in the console. Sometimes the number of them even changes, but’s it’s never all of them.

Any idea why it may be happening? Has anyone met this problem before?

Let me know =)

Small update: looks like the tests stop working when I comment the last line in server.js file, which is the export of the app module.

const express = require('express');
const errorHandler = require('errorhandler');

const apiRouter = require('./api/api');

const app = express();
const PORT = process.env.PORT || 4000;

app.use('/api', apiRouter);


app.listen(PORT, () => {
    console.log(`Listening on port ${PORT}`);

module.exports = app;

Another strange thing is, whatever I comment out or not, once the tests are done executing, control doesn’t go back to the command line but the console stays idle.