const { parse } = require('./jsxParser.js'); const result1 = require('./result1.json'); const cmps = { ExampleComponent: { x: 'examplecomponent' }, home: 'home', ExampleWithChildren: 'examplewithchildren', enclosed: 'enclosed', }; // Example includes: // - nested components // - HTML entities // - inline styles // - classNames // - attribute without a value const str = `
<text>
`; const result = parse(str, cmps, (tag, attrs) => ({ tag, attrs })); if (JSON.stringify(result) != JSON.stringify(result1)) { process.stderr.write('Test failed, got:\n'); process.stderr.write(JSON.stringify(result, null, 2)); process.exit(1); }