import { describe, it, expect } from 'vitest'; import { load } from './index.js'; describe('.load', () => { it('(html) : should retain original root after creating a new node', () => { const $ = load(''); expect($('body')).toHaveLength(1); $('', { xml: true, }); expect($('script')[0].children[0].type).toBe('tag'); }); it('(buffer) : should accept a buffer', () => { const html = 'foo'; const $html = load(Buffer.from(html)); expect($html.html()).toBe(html); }); });