| Name | Size | Mode | Actions |
|---|---|---|---|
| api.attributes.js | 22831 | 0644 | editdlrm |
| api.css.js | 3254 | 0644 | editdlrm |
| api.manipulation.js | 31129 | 0644 | editdlrm |
| api.traversing.js | 40690 | 0644 | editdlrm |
| api.utils.js | 5773 | 0644 | editdlrm |
| cheerio.js | 9693 | 0644 | editdlrm |
| fixtures.js | 1733 | 0644 | editdlrm |
| mocha.opts | 23 | 0644 | editdlrm |
| parse.js | 7116 | 0644 | editdlrm |
| utilities.js | 1159 | 0644 | editdlrm |
| xml.js | 1891 | 0644 | editdlrm |
/var/www/greso.tech/server/nsm/node_modules/cheerio/test/api.utils.js (5773B)
', { xmlMode : true }); // console.log($html('script')[0].type); // expect($html('script')[0].type).to.be('tag'); // }); it('(buffer) : should accept a buffer', function() { var $html = cheerio.load(new Buffer('
')); expect($html.html()).to.be('
'); }); }); describe('.clone', function() { it('() : should return a copy', function() { var $src = cheerio('
').children(); var $elem = $src.clone(); expect($elem.length).to.equal(3); expect($elem.parent()).to.have.length(0); expect($elem.text()).to.equal($src.text()); $src.text('rofl'); expect($elem.text()).to.not.equal($src.text()); }); }); describe('.parseHTML', function() { it('() : returns null', function() { expect(cheerio.parseHTML()).to.equal(null); }); it('(null) : returns null', function() { expect(cheerio.parseHTML(null)).to.equal(null); }); it('("") : returns null', function() { expect(cheerio.parseHTML('')).to.equal(null); }); it('(largeHtmlString) : parses large HTML strings', function() { var html = new Array(10).join('
'); var nodes = cheerio.parseHTML(html); expect(nodes.length).to.be.greaterThan(4); expect(nodes).to.be.an('array'); }); it('("'; expect(cheerio.parseHTML(html)).to.have.length(0); }); it('("'; expect(cheerio.parseHTML(html, true)[0].name).to.match(/script/i); }); it('("scriptAndNonScript) : preserves non-script nodes', function() { var html = '
'; expect(cheerio.parseHTML(html)[0].name).to.match(/div/i); }); it('(scriptAndNonScript, true) : Preserves script position', function() { var html = '
'; expect(cheerio.parseHTML(html, true)[0].name).to.match(/script/i); }); it('(text) : returns a text node', function() { expect(cheerio.parseHTML('text')[0].type).to.be('text'); }); it('(\\ttext) : preserves leading whitespace', function() { expect(cheerio.parseHTML('\t
')[0].data).to.equal('\t'); }); it('( text) : Leading spaces are treated as text nodes', function() { expect(cheerio.parseHTML('
')[0].type).to.be('text'); }); it('(html) : should preserve content', function() { var html = '
';
expect(cheerio(cheerio.parseHTML(html)[0]).html()).to.equal('test div');
});
it('(malformedHtml) : should not break', function() {
expect(cheerio.parseHTML('')).to.have.length(1);
});
it('(garbageInput) : should not cause an error', function() {
expect(cheerio.parseHTML('<#if> This is a test. <#/if>') || true).to.be.ok();
});
});
describe('.root', function() {
it('() : should return a cheerio-wrapped root object', function() {
var $html = cheerio.load('