Comparing version 1.0.1 to 1.1.0
27
index.js
@@ -37,2 +37,5 @@ 'use strict'; | ||
// Hack to collect todo's for later filtering them out of the failures array | ||
const todos = []; | ||
const stream = duplexer(tap, out); | ||
@@ -52,2 +55,3 @@ | ||
} else if (res.todo) { | ||
todos.push(res); | ||
char = symbols.todo; | ||
@@ -64,6 +68,23 @@ } else if (res.ok) { | ||
tap.on('complete', function(res) { | ||
const fails = res.failures; | ||
const fails = res.failures.filter(f => !todos.find(t => t === f)); | ||
console.log('fails', fails.length); | ||
console.log('todos', todos.length); | ||
outPush('\n'); | ||
if (todos.length > 0) { | ||
todos.forEach(function (todo) { | ||
const { operator, expected, actual, at } = todo.diag; | ||
outPush(blue(`! TODO ${todo.name}`)); | ||
operator && outPush(`${blue('·') + yellow(' operator:')} ${operator}`); | ||
expected && outPush(`${blue('·') + yellow(' expected:')} ${expected}`); | ||
actual && outPush(`${blue('·') + yellow(' actual:')} ${actual}`); | ||
at && outPush(`${blue('·') + yellow(' at:')} ${at}`); | ||
outPush(''); | ||
}); | ||
} | ||
if (fails.length > 0) { | ||
@@ -75,3 +96,3 @@ stream.failed = true; | ||
outPush(red(`✖ ${fail.name}`)); | ||
outPush(red(`✖ FAIL ${fail.name}`)); | ||
operator && outPush(`${red('|') + blue(' operator:')} ${operator}`); | ||
@@ -91,3 +112,3 @@ expected && outPush(`${red('|') + blue(' expected:')} ${expected}`); | ||
todo: String(res.todo || 0), | ||
fail: String(res.fail || 0) | ||
fail: String(fails.length || 0) | ||
}; | ||
@@ -94,0 +115,0 @@ |
{ | ||
"name": "tap-spot", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Compact dot reporter for TAP output. Supports skip and todo", | ||
@@ -5,0 +5,0 @@ "main": "./bin/dot.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7379
111