I've got some mocha tests that require data from prior function calls. However, because my code is using a web service, I would like it to wait for a predetermined amount of time before running the next test.
Something like this:
var global;
it('should give some info', function(done) {
run.someMethod(param, function(err, result) {
global = result.global
done();
});
});
wait(30000); // basically block it from running the next assertion
it('should give more info', function(done) {
run.anotherMethod(global, function(err, result) {
expect(result).to.be.an('object');
done();
});
});
Any ideas would be appreciated. Thanks!