Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tap-mocha-reporter

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tap-mocha-reporter - npm Package Compare versions

Comparing version 3.0.7 to 3.0.8

lib/reporters/.base.js.swp

6

lib/reporters/base.js

@@ -395,4 +395,6 @@ /**

}
var msg = diff.createPatch('string', err.actual, err.expected);
var lines = msg.split('\n').splice(4);
var lines = (err.diff.split('\n').slice(2) ||
diff.createPatch('string', err.actual, err.expected)
.split('\n').slice(4));
return '\n '

@@ -399,0 +401,0 @@ + colorLines('diff added', '+ expected') + ' '

@@ -23,3 +23,3 @@ exports = module.exports = Classic

function doDiff (found, wanted, palette) {
function doDiff (found, wanted, patch) {
// TODO: Make this a configurable thing or something?

@@ -54,3 +54,3 @@ //

// TODO: add a TrueColor one that looks nicer
palette = colorSupport.has256 ? 6 : 1
var palette = colorSupport.has256 ? 6 : 1

@@ -152,5 +152,8 @@ var plain = ''

var patch = diff.createPatch('', wanted, found)
//console.error(patch)
var width = 0
patch = patch || (
['--- wanted', '+++ found'].concat(
diff.createPatch('', wanted, found).split(/\n/).slice(5)
).join('\n'))
patch = patch.split('\n').map(function (line, index) {

@@ -165,5 +168,5 @@ if (uclen(line) > width)

}).filter(function (line, i) {
return line && i > 4
return line
}).map(function (line) {
if (uclen(line) < width)
if (uclen(line) <= width)
line += repeat(width - uclen(line) + 1, ' ')

@@ -180,13 +183,3 @@ return line

var pref =
bg + added + '+++ found' +
(Base.useColors
? repeat(width - '+++ found'.length + 1, ' ')
: '') +
reset + '\n' +
bg + removed + '--- wanted' +
(Base.useColors
? repeat(width - '--- wanted'.length + 1, ' ')
: '') +
reset + '\n'
var pref =''

@@ -285,7 +278,9 @@ return pref + patch

if (hasOwnProperty(t.diag, 'found') &&
hasOwnProperty(t.diag, 'wanted')) {
hasOwnProperty(t.diag, 'wanted') ||
hasOwnProperty(t.diag, 'diff')) {
printDiff = true
var found = t.diag.found
var wanted = t.diag.wanted
failMsg += indent(doDiff(found, wanted), 2) + '\n'
var diff = doDiff(found, wanted, t.diag.diff)
failMsg += indent(diff, 2) + '\n'
}

@@ -297,3 +292,3 @@

// Don't re-print what we already showed in the diff
if (printDiff && ( i === 'found' || i === 'wanted'))
if (printDiff && ( i === 'found' || i === 'wanted' || i === 'pattern' || i === 'diff'))
continue

@@ -300,0 +295,0 @@ o[i] = t.diag[i]

@@ -334,3 +334,7 @@ // A facade from the tap-parser to the Mocha "Runner" object.

var hasWanted = diag.hasOwnProperty('wanted')
var hasDiff = diag.hasOwnProperty('diff')
if (hasDiff)
err.diff = diag.diff
if (hasFound)

@@ -342,3 +346,3 @@ err.actual = diag.found

if (hasFound && hasWanted)
if (hasFound && hasWanted || hasDiff)
err.showDiff = true

@@ -345,0 +349,0 @@ }

{
"name": "tap-mocha-reporter",
"version": "3.0.7",
"version": "3.0.8",
"description": "Format a TAP stream using Mocha's set of reporters",

@@ -30,3 +30,3 @@ "main": "index.js",

"devDependencies": {
"tap": "^6.2.0"
"tap": "^12.5.3"
},

@@ -33,0 +33,0 @@ "bin": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc