Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "chai-style", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "CSS Style assertions for elements, using Chai.js", | ||
@@ -5,0 +5,0 @@ "main": "sources/index.js", |
@@ -45,5 +45,9 @@ module.exports = chaiStyle | ||
return hasAutoValue | ||
const comparisonResult = hasAutoValue | ||
? reg.test(computed) | ||
: computed === value | ||
document.body.removeChild(iframe) | ||
return comparisonResult | ||
} | ||
@@ -50,0 +54,0 @@ }) |
@@ -181,2 +181,11 @@ const {describe, it, before, beforeEach} = require('mocha') | ||
}) | ||
describe('cleanup', () => { | ||
it('does not leave elements in DOM after running', () => { | ||
const childCountPreMatcher = document.body.children.length | ||
expect(element).to.have.style('color', 'red') | ||
const childCountPostMatcher = document.body.children.length | ||
expect(childCountPreMatcher).to.equal(childCountPostMatcher) | ||
}) | ||
}) | ||
}) | ||
@@ -183,0 +192,0 @@ |
16430
302
11