Comparing version 1.2.1 to 1.3.0
@@ -101,3 +101,3 @@ 'use strict'; | ||
this.writingErrorOutput = true; | ||
this.lastAsserRawErrorArray = {}; | ||
this.lastAsserRawErrorString = ''; | ||
} | ||
@@ -117,3 +117,4 @@ // End of error output | ||
lastAssert.error.raw = this.lastAsserRawErrorArray; | ||
// right-trimmed raw error string | ||
lastAssert.error.raw = this.lastAsserRawErrorString.replace(/\s+$/g, ''); | ||
@@ -132,3 +133,3 @@ this.emit('fail', lastAssert); | ||
// Rebuild raw error output | ||
this.lastAsserRawErrorArray[m[0]] = m[1]; | ||
this.lastAsserRawErrorString += line + '\n'; | ||
@@ -226,2 +227,2 @@ if (m[0] === 'stack') { | ||
return [parts[0], parts.slice(1).join(pattern)]; | ||
} | ||
} |
{ | ||
"name": "tap-out", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "A different tap parser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -317,8 +317,8 @@ var parser = require('../'); | ||
operator: 'equal', | ||
raw:{ | ||
actual:' \'me\'', | ||
at:' Test.<anonymous> (/Users/scott/www/divshot/divshot-cli/test/index.js:8:5)', | ||
expected:' \'you\'', | ||
operator:' equal' | ||
} | ||
raw: [ | ||
" operator: equal", | ||
" expected: 'you'", | ||
" actual: 'me'", | ||
" at: Test.<anonymous> (/Users/scott/www/divshot/divshot-cli/test/index.js:8:5)" | ||
].join('\n') | ||
}, | ||
@@ -337,7 +337,7 @@ name: 'strings match', | ||
operator: 'count', | ||
raw:{ | ||
actual:' 3', | ||
expected:' 4', | ||
operator:' fail' | ||
} | ||
raw: [ | ||
" operator: fail", | ||
" expected: 4", | ||
" actual: 3" | ||
].join('\n') | ||
}, | ||
@@ -461,2 +461,49 @@ name: 'plan != count', | ||
p.end(); | ||
}); | ||
}); | ||
test('handles raw error string', function (t) { | ||
t.plan(1); | ||
var rawLines = [ | ||
" operator: deepEqual", | ||
" expected:", | ||
" { 0: 0, 1: 0, 10: 0, 11: 255, 12: 0, 13: 0, 14: 0, 15: 255, 2: 0, 3: 221, 4: 0, 5: 0, 6: 0, 7: 255, 8: 0, 9: 0 }", | ||
" actual:", | ||
" { 0: 0, 1: 0, 10: 0, 11: 255, 12: 0, 13: 0, 14: 0, 15: 255, 2: 0, 3: 255, 4: 0, 5: 0, 6: 0, 7: 255, 8: 0, 9: 0 }", | ||
" at: Test.<anonymous> (http://localhost:9966/index.js:8:5)" | ||
]; | ||
var mockTap = [ | ||
"TAP version 13", | ||
"# is true", | ||
"ok 1 true value", | ||
"ok 2 true value", | ||
"not ok 3 arrays match", | ||
" ---" | ||
].concat(rawLines).concat([ | ||
" ...", | ||
"not ok 15 plan != count", | ||
" ---", | ||
" operator: fail", | ||
" expected: 4", | ||
" actual: 3", | ||
" ...", | ||
"", | ||
"1..15", | ||
]); | ||
var p = parser(); | ||
p.on('output', function (output) { | ||
var assert = output.fail[0]; | ||
t.deepEqual(assert.error.raw, rawLines.join('\n')); | ||
}); | ||
mockTap.forEach(function (line) { | ||
p.write(line + '\n'); | ||
}); | ||
p.end(); | ||
}); | ||
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
24881
687