Skip to content

Commit

Permalink
Updated async_it
Browse files Browse the repository at this point in the history
Previous version would hide errors in the function call.
  • Loading branch information
LeonardoVal committed Jan 15, 2016
1 parent 916e447 commit 74d595e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/karma-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,20 @@ beforeEach(function() { // Add custom matchers.

function async_it(desc, func) { // Future friendly version of it().
it(desc, function () {
var done = false;
var finished = false;
runs(function () {
func().then(function () {
done = true;
})
try {
func().then(function () {
finished = true;
});
} catch (err) {
console.error(err);
finished = true;
}
});
waitsFor(function () {
return done;
});
return finished;
}, "Test took too long!", 10000);
});
}

Expand Down

0 comments on commit 74d595e

Please sign in to comment.