Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Mar 10, 2015
1 parent 078b2db commit 4cc5c32
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@ function stringifyEndTag(element) {
return '</' + elementName + '>';
}

function stringifyElement(element) {
var elementName = element.nodeName.toLowerCase();
var str = stringifyStartTag(element);
if (!isVoidElement(elementName)) {
if (element.children.length > 0) {
str += '...';
}
str += stringifyEndTag(element);
}
return str;
}

module.exports = {
name: 'unexpected-dom',
installInto: function (expect) {
Expand Down Expand Up @@ -272,7 +260,7 @@ module.exports = {
changes.forEach(function (diffItem, index) {
output.i().block(function () {
var type = diffItem.type;
var last = !!diffItem.last;
// var last = !!diffItem.last;

if (type === 'insert') {
this.annotationBlock(function () {
Expand Down Expand Up @@ -302,12 +290,13 @@ module.exports = {
}

if (isVoidElement(actual.nodeName) && actual.childNodes.length === 0 && expected.childNodes.length === 0) {
return result;
}

if (actual.nodeName.toLowerCase() === expected.nodeName.toLowerCase()) {
output.code(stringifyEndTag(actual), 'html');
} else {
if (actual.nodeName.toLowerCase() === expected.nodeName.toLowerCase()) {
output.code(stringifyEndTag(actual), 'html');
} else {
output.append(diff(stringifyEndTag(actual), stringifyEndTag(expected)).diff);
}
output.append(diff(stringifyEndTag(actual), stringifyEndTag(expected)).diff);
}

return result;
Expand Down

0 comments on commit 4cc5c32

Please sign in to comment.