describe('textContent', function () { var chai = require('chai'), assert = chai.assert; var DomParser = require('../index.js'), parser = new DomParser(); it('unclosed tag', function(){ var html = '
\n' + '
\n' + ' some text\n' + ' \n' + '
\n' + '
123
\n' + '
\n' + ' some text\n' + '
\n' + '
\n' + '
'; var dom = parser.parseFromString(html), ctn = dom.getElementById('root'); assert.equal(ctn.textContent, '\n \n some text\n \n \n 123 \n \n some text\n \n \n'); }); });