Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

also check for asserts.length #60

Merged
merged 1 commit into from May 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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