Can promise be run and fulfilled outside of Describe
and It
blocks in Mocha.js?
I have following case:
login().then(function(spaces) {
if (spaces.length > 1) {
_.forEach(space, function() {
describe(space.name, function() {
it('test1');
it('test2');
it('test3');
});
});
} else {
describe(space.name, function() {
it('test4');
});
}
});
But the tests don't seem to run. I tried to add return
in front of login() as well since login is a promise. Still no luck. I would like to have my space.name
listed out as describe
name, but that name will be a result of login function...