Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancahill committed Nov 3, 2015
1 parent 1918d9e commit 6f05420
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
35 changes: 33 additions & 2 deletions lib/eminent.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,39 @@ var compareNode = function compareNode(node, tree, hasAttrs, isAttrs, isContent)
_assert2.default.fail(_getNodeHTML(node, false), _getTreeHTML(tree, false), 'Attribute \'' + attrName + '\' does not exist', '!=');
}
} else if (isAttrs) {
if (node.getAttribute(attrName) !== attrValue) {
_assert2.default.fail(_getNodeHTML(node, false), _getTreeHTML(tree, false), 'Value of attribute \'' + attrName + '\' is not \'' + attrValue + '\'', '!=');
if (attrName === 'class') {
var classNames = attrValue.split(/\s+/).filter(Boolean);

var _iteratorNormalCompletion4 = true;
var _didIteratorError4 = false;
var _iteratorError4 = undefined;

try {
for (var _iterator4 = classNames[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
var className = _step4.value;

if (!node.classList.contains(className)) {
_assert2.default.fail(_getNodeHTML(node, false), _getTreeHTML(tree, false), 'Element does not contain class \'' + className + '\'', '!=');
}
}
} catch (err) {
_didIteratorError4 = true;
_iteratorError4 = err;
} finally {
try {
if (!_iteratorNormalCompletion4 && _iterator4.return) {
_iterator4.return();
}
} finally {
if (_didIteratorError4) {
throw _iteratorError4;
}
}
}
} else {
if (node.getAttribute(attrName) !== attrValue) {
_assert2.default.fail(_getNodeHTML(node, false), _getTreeHTML(tree, false), 'Value of attribute \'' + attrName + '\' is not \'' + attrValue + '\'', '!=');
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eminent",
"version": "0.0.7",
"version": "0.0.8",
"description": "A DOM assertions library with Emmet syntax for JavaScript testing",
"main": "lib/eminent.js",
"scripts": {
Expand Down

0 comments on commit 6f05420

Please sign in to comment.