renovate/lib/util/html.spec.ts
renovate[bot] 2d2e95c747
chore(deps): update dependency typescript to v4 (#7092)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jamie Magee <jamie.magee@gmail.com>
Co-authored-by: Jamie Magee <JamieMagee@users.noreply.github.com>
2020-09-08 12:26:17 +02:00

16 lines
478 B
TypeScript

import { getName } from '../../test/util';
import { parse } from './html';
describe(getName(__filename), () => {
it('parses HTML', () => {
const body = parse('<div>Hello, world!</div>');
expect(body.childElementCount).toBe(1);
const div = body.children[0];
expect(div.tagName).toBe('DIV');
expect(div.textContent).toBe('Hello, world!');
});
it('returns empty', () => {
const body = parse('');
expect(body.childElementCount).toBe(0);
});
});