import { describe, it, expect, beforeEach } from 'vitest'; import { cheerio, food, eleven } from './__fixtures__/fixtures.js'; import { type CheerioAPI } from './index.js'; describe('cheerio', () => { describe('.html', () => { it('() : should return innerHTML; $.html(obj) should return outerHTML', () => { const $div = cheerio( 'div', '
foo bar
', ); const span = $div.children()[1]; expect(cheerio(span).html()).toBe('bar'); expect(cheerio.html(span)).toBe('bar'); }); it('() : should accept an object, an array, or a cheerio object', () => { const $span = cheerio('foo'); expect(cheerio.html($span[0])).toBe('foo'); expect(cheerio.html($span)).toBe('foo'); }); it('() : should be able to set to an empty string', () => { const $elem = cheerio('foo').html(''); expect(cheerio.html($elem)).toBe(''); }); it('() : does not render the root element', () => { const $ = cheerio.load(''); expect(cheerio.html($.root())).toBe( '