Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
manikumar446 opened this issue Jun 16, 2017 · 4 comments
Closed

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

manikumar446 opened this issue Jun 16, 2017 · 4 comments

Comments

@manikumar446
Copy link

manikumar446 commented Jun 16, 2017

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

@ScottFreeCode
Copy link
Contributor

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!

@manikumar446
Copy link
Author

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

@ScottFreeCode
Copy link
Contributor

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!

@hemanh27
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants