/var/www/greso.tech/server/nsm/node_modules/cheerio/test
NameSizeModeActions
api.attributes.js228310644editdlrm
api.css.js32540644editdlrm
api.manipulation.js311290644editdlrm
api.traversing.js406900644editdlrm
api.utils.js57730644editdlrm
cheerio.js96930644editdlrm
fixtures.js17330644editdlrm
mocha.opts230644editdlrm
parse.js71160644editdlrm
utilities.js11590644editdlrm
xml.js18910644editdlrm
Edit: /var/www/greso.tech/server/nsm/node_modules/cheerio/test/utilities.js (1159B)
var expect = require('expect.js'), cheerio = require('..'), food = require('./fixtures').food; describe('utility methods', function() { describe('.contains', function() { var $; beforeEach(function() { $ = cheerio.load(food); }); it('(container, contained) : should correctly detect the provided element', function() { var $food = $('#food'); var $fruits = $('#fruits'); var $apple = $('.apple'); expect($.contains($food[0], $fruits[0])).to.equal(true); expect($.contains($food[0], $apple[0])).to.equal(true); }); it('(container, other) : should not detect elements that are not contained', function() { var $fruits = $('#fruits'); var $vegetables = $('#vegetables'); var $apple = $('.apple'); expect($.contains($vegetables[0], $apple[0])).to.equal(false); expect($.contains($fruits[0], $vegetables[0])).to.equal(false); expect($.contains($vegetables[0], $fruits[0])).to.equal(false); expect($.contains($fruits[0], $fruits[0])).to.equal(false); expect($.contains($vegetables[0], $vegetables[0])).to.equal(false); }); }); });