assert-element
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "assert-element", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "component/assert": "*" |
0.3.0 / 2015-09-16 | ||
================== | ||
* hasChildren: support a single string element as the criteria | ||
0.2.0 / 2015-09-16 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -76,2 +76,4 @@ | ||
node.children.forEach(children); | ||
} else if (typeof children === 'string') { | ||
assert.deepEqual(node.children, [ children ]); | ||
} else { | ||
@@ -78,0 +80,0 @@ assert(node.children.length > 0, 'expected to find child nodes'); |
{ | ||
"name": "assert-element", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Assertions for checking virtual nodes used by Deku/React/etc", | ||
@@ -5,0 +5,0 @@ "repository": "dekujs/assert-element", |
@@ -189,2 +189,14 @@ | ||
it('should treat a string argument as a single child array', function () { | ||
assertions.hasChildren(element('div', null, 'a'), 'a'); | ||
}); | ||
it('should throw if the children does not match the single argument', fail(function () { | ||
assertions.hasChildren(element('div', null, 'a'), 'b'); | ||
})); | ||
it('should throw if there are multiple children and a single argument is passed', fail(function () { | ||
assertions.hasChildren(element('div', null, 'a', 'b'), 'a'); | ||
})); | ||
it('should not throw when the fn does not throw for any node', function () { | ||
@@ -191,0 +203,0 @@ assertions.hasChildren(element('div', null, 'a'), test); |
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
25166
455