Reputation: 847
Pretty new to Mocha and testing here, so hoping somebody can help me out or point me in the right direction.
What I am trying to do is have a mochaJS test run every 5 minutes for an entire day. However, I don't want to actually type the command, and am hoping that I could write some code that would carry this out.
So far, I have tried adjusting the this.timeout in the mocha test, and then setting javascript intervals (setInterval(function(){}, time)) and using while loops with the setTimeout.
Is it possible to set an interval like this in mocha?
Or is there some other way around this, say through command line, that would execute the mocha test every 5 minutes?
Thank you for your advice and expertise!
Cheers
Upvotes: 1
Views: 970
Reputation: 572
This really sounds like a task that should be managed by a Continuous Integration server such as Jenkins.
If you install Jenkins, you can create a new job that will run the tests you want on a given interval, ie. every 5 minutes. Better yet, you can connect the Job to your source code repo and run the job on any code push.
Upvotes: 3