Skip to content

Commit 3938f56

Browse files
test(types): add tests for updated options.library types
1 parent ffb7964 commit 3938f56

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/types/index.test.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ options = {
4949
// $ExpectType Element | Element[]
5050
parse('<a id="header" href="#">Heading</a>', options);
5151

52+
// $ExpectType Element | Element[]
53+
parse('<hr>', {
54+
library: {
55+
cloneElement: (element, props, children) =>
56+
React.cloneElement(element, props, children),
57+
createElement: (type, props, children) =>
58+
React.createElement(type, props, children),
59+
isValidElement: element => React.isValidElement(element)
60+
}
61+
});
62+
5263
// $ExpectType DomElement[]
5364
const domNodes = htmlToDOM('<div>text</div>');
5465

0 commit comments

Comments
 (0)