Expresso number of tests changes unexpectedly

While running tests on the Expresso project, sometimes I find that the number of tests are changing. Sometimes it is about 76 tests and sometime about 45 tests.
What could be the possible reason?

I’m not sure I know the answer but if you post a screenshot of what you are seeing someone may be able to advise or figure it out.

employeeRouter.param('employeeId', (req, res, next, employeeId) => {
    db.get('SELECT * FROM Employee WHERE id=$id', {$id: employeeId}, (err, row) => {
            **return** res.sendStatus(404)
        } else if(!row) {
            **return** res.sendStatus(404);
        } else {
            req.employee = row;

When I use return with res.send, I get more tests evaluated, than without it.

There might be something in the read out from the test that explains it. Don’t know if you could screenshot the two differing outcomes.

Thanks for your reply, but as I keep on writing codes and passing tests, the issue got resolved.

1 Like