Comparing version 0.1.9 to 0.2.0
@@ -15,2 +15,15 @@ #!/usr/bin/env node | ||
var symbols = { | ||
ok: '\u2713', | ||
err: '\u2717' | ||
}; | ||
// win32 console default output fonts don't support tick/cross | ||
if (process && process.platform === 'win32') { | ||
symbols = { | ||
ok: '\u221A', | ||
err: '\u00D7' | ||
}; | ||
} | ||
out.push('\n'); | ||
@@ -20,3 +33,3 @@ | ||
currentTestName = comment; | ||
if (/^tests\s+[1-9]/gi.test(comment)) comment = chalk.white(comment); | ||
@@ -27,3 +40,3 @@ else if (/^pass\s+[1-9]/gi.test(comment)) comment = chalk.green(comment); | ||
else out.push('\n'); | ||
out.push(' ' + comment + '\n'); | ||
@@ -34,7 +47,7 @@ }); | ||
var output = (res.ok) | ||
? chalk.green('\u2713') | ||
: chalk.red('✗'); | ||
? chalk.green(symbols.ok) | ||
: chalk.red(symbols.err); | ||
if (!res.ok) errors.push(currentTestName + ' ' + res.name); | ||
out.push(' ' + output + ' ' + chalk.gray(res.name) + '\n'); | ||
@@ -52,8 +65,8 @@ }); | ||
var plural = (errors.length == 1) ? 'failure' : 'failures'; | ||
out.push(' ' + chalk.red('Failed Tests: ')); | ||
out.push('There ' + past + ' ' + chalk.red(errors.length) + ' ' + plural + '\n\n'); | ||
errors.forEach(function (error) { | ||
out.push(' ' + chalk.red('✗') + ' ' + chalk.red(error) + '\n'); | ||
out.push(' ' + chalk.red(symbols.err) + ' ' + chalk.red(error) + '\n'); | ||
}); | ||
@@ -72,3 +85,3 @@ } | ||
.pipe(process.stdout); | ||
process.on('exit', function () { | ||
@@ -75,0 +88,0 @@ if (errors.length || !res.ok) { |
{ | ||
"name": "tap-spec", | ||
"version": "0.1.9", | ||
"version": "0.2.0", | ||
"description": "Formatted TAP output like Mocha's spec reporter", | ||
@@ -26,4 +26,4 @@ "scripts": { | ||
"chalk": "~0.4.0", | ||
"through2": "~0.2.3", | ||
"tap-parser": "~0.4.1", | ||
"through2": "~0.4.1", | ||
"tap-parser": "~0.5.0", | ||
"duplexer": "~0.1.1" | ||
@@ -30,0 +30,0 @@ }, |
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
3271
68
+ Addedreadable-stream@1.0.34(transitive)
+ Addedtap-parser@0.5.0(transitive)
+ Addedthrough2@0.4.2(transitive)
- Removedtap-parser@0.4.3(transitive)
- Removedthrough2@0.2.3(transitive)
Updatedtap-parser@~0.5.0
Updatedthrough2@~0.4.1