Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
support new version of grunt that no longer has a build in error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
vikeen committed Jan 9, 2017
1 parent c83747f commit 08b211c
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions tasks/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,22 @@ module.exports = function (grunt) {
require(f);
});
it.run().then(function (results) {
if (oToString(results) === "[object Number]") {
done(0 === results);
} else {
done(results.errorCount === 0 &&
results.totalCount === (results.successCount + results.skippedCount) &&
results.pendingCount === 0);
// support "no tests found"
if (results === undefined) {
return done(true);
}

try {
if (oToString(results) === "[object Number]") {
done(0 === results);
} else {
done(results.errorCount === 0 &&
results.totalCount === (results.successCount + results.skippedCount) &&
results.pendingCount === 0);
}
} catch (error) {
console.error(error);
done(false);
}
});
}
Expand Down

0 comments on commit 08b211c

Please sign in to comment.