Mocha: Not able to run Mocha tests with node-schedule npm module

Created on 16 Jun 2017  路  4Comments  路  Source: mochajs/mocha

I've setup a suite of tests in mocha using Sinon and Chai.
What I'm aiming for is that the tests will run daily and then email the results to my team.
So I installed below npm modules,
--> node-schedule: To run tests daily
--> mocha-runner-reporter: To send the test report as email.

The tests are all running and sending email as expected only first time. From second time on wards it's neither running the tests nor sending email. I have attached the sample project as well.
i'd appreciate any suggestions.

Samplecode.zip

Most helpful comment

@ScottFreeCode Thank you for the reply. I have tried all workarounds mentioned in above comment. This work around solved my problem.

All 4 comments

I'm not familiar with mocha-runner-reporter, but if it uses Mocha's programmatic API and isn't doing anything to work around Mocha's known issues with running the programmatic API multiple times then you might have to apply some of those workarounds yourself if possible (e.g. see if it works if you clear the require cache before each run). Let me know if that works for you!

@ScottFreeCode Thank you for the reply. I have tried all workarounds mentioned in above comment. This work around solved my problem.

Awesome! Glad that worked.

I'm going to go ahead and close this since we have those other issues for the same problem already, but feel free to participate there if you have any new ideas, suggestions or questions!

@manikumar446 Could you post your updated or modified sample code if possible. Still facing the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luoxi001713 picture luoxi001713  路  3Comments

3p3r picture 3p3r  路  3Comments

smithamax picture smithamax  路  4Comments

robertherber picture robertherber  路  3Comments

delta62 picture delta62  路  3Comments