File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ var domToReact = require('./lib/dom-to-react');
22var attributesToProps = require ( './lib/attributes-to-props' ) ;
33var htmlToDOM = require ( 'html-dom-parser' ) ;
44
5+ // support backwards compatibility for ES Module
6+ htmlToDOM =
7+ /* istanbul ignore next */
8+ typeof htmlToDOM . default === 'function' ? htmlToDOM . default : htmlToDOM ;
9+
510var domParserOptions = { lowerCaseAttributeNames : false } ;
611
712/**
Original file line number Diff line number Diff line change @@ -6,18 +6,23 @@ const { render } = require('./helpers');
66describe ( 'module' , ( ) => {
77 it ( 'exports default' , ( ) => {
88 expect ( parse . default ) . toBe ( parse ) ;
9+ expect ( parse . default ) . toBeInstanceOf ( Function ) ;
910 } ) ;
1011
1112 it ( 'exports domToReact' , ( ) => {
1213 expect ( parse . domToReact ) . toBe ( require ( '../lib/dom-to-react' ) ) ;
14+ expect ( parse . domToReact ) . toBeInstanceOf ( Function ) ;
1315 } ) ;
1416
1517 it ( 'exports htmlToDOM' , ( ) => {
1618 expect ( parse . htmlToDOM ) . toBe ( require ( 'html-dom-parser' ) ) ;
19+ expect ( parse . htmlToDOM ) . toBeInstanceOf ( Function ) ;
20+ expect ( parse . htmlToDOM . default ) . toBe ( undefined ) ;
1721 } ) ;
1822
1923 it ( 'exports attributesToProps' , ( ) => {
2024 expect ( parse . attributesToProps ) . toBe ( require ( '../lib/attributes-to-props' ) ) ;
25+ expect ( parse . attributesToProps ) . toBeInstanceOf ( Function ) ;
2126 } ) ;
2227} ) ;
2328
You can’t perform that action at this time.
0 commit comments