Skip to content

Commit

Permalink
Merge pull request #60 from maxlutay/check-asserts-length
Browse files Browse the repository at this point in the history
also check for asserts.length
  • Loading branch information
scottcorgan committed May 29, 2018
2 parents 90cb1b8 + 484f694 commit 810d5ae
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Expand Up @@ -89,9 +89,10 @@ module.exports = function (spec) {
output.push('\n\n\n');

// Exit if no tests run. This is a result of 1 of 2 things:
// 1. No tests were written
// 1. No tests and asserts were written
// 2. There was some error before the TAP got to the parser
if (results.tests.length === 0) {
if (results.tests.length === 0 &&
results.asserts.length === 0) {
process.exit(1);
}
});
Expand Down Expand Up @@ -120,7 +121,8 @@ module.exports = function (spec) {

function formatTotals (results) {

if (results.tests.length === 0) {
if (results.tests.length === 0 &&
results.asserts.length === 0) {
return pad(format.red(symbols.cross + ' No tests found'));
}

Expand Down

0 comments on commit 810d5ae

Please sign in to comment.