Skip to content

Commit cfb4ec8

Browse files
test(html-to-react): add test for option library
Although we have a test in dom-to-react, adding one here helps with completeness.
1 parent 466688b commit cfb4ec8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/html-to-react.js

+10
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,15 @@ describe('HTML to React', () => {
127127
);
128128
});
129129
});
130+
131+
describe('library', () => {
132+
it('converts with Preact instead of React', () => {
133+
const Preact = require('preact');
134+
const html = data.html.single;
135+
const options = { library: Preact };
136+
const preactElement = parse(html, options);
137+
assert.deepEqual(preactElement, Preact.createElement('p', {}, 'foo'));
138+
});
139+
});
130140
});
131141
});

0 commit comments

Comments
 (0)