Closed buschtoens closed 11 years ago
Comparing the length of the strings shows, that one is two chars longer. But I can't see where those extra chars are. They're not at the start and not at the end.
var expected = fixture("positioning.svg");
var found = [], diff = 0;
badge(500, { subtitlePos: "right" }).split("").forEach(function(actualChar, index) {
var expectedChar = expected.charAt(index+diff);
if(actualChar != expectedChar) {
found.push({ actual: actualChar, expected: expectedChar });
diff++;
}
});
console.log(found);
[ { actual: '<', expected: '\t' },
{ actual: '<', expected: '\t' },
{ actual: 'r', expected: '<' },
{ actual: '<', expected: '\t' },
{ actual: 'c', expected: '<' },
{ actual: '<', expected: '\t' },
{ actual: 'p', expected: '<' },
{ actual: '<', expected: '\t' },
{ actual: 'p', expected: '<' },
{ actual: '<', expected: '\t' },
{ actual: 't', expected: '<' },
{ actual: '<', expected: '\t' },
{ actual: 't', expected: '<' },
{ actual: '<', expected: '\t' } ]
Seems like should.js has trouble displaying tabs.
My error is fixed now. I accidentally double indented positioning.svg
. Nevertheless the issue remains. should.js doesn't highlight errors on tabs.
It is mocha issue. Should.js just complain that it is not equal, test runner create diff for you.
So it is better to duplicated issue to mocha.
I was doing the tests on my badge and this error caught my attention. should.js doesn't show which part of the string is unequal.
excerpt of
test.js
I think should.js complains about
\r
or\n
, but it isn't shown.