Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
2081ea4
commit 2d2e95c
Showing
6 changed files
with
57 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { JSDOM } from 'jsdom'; | ||
|
||
export function parse(html: string): HTMLElement { | ||
return new JSDOM(html).window.document.body; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters