preact-jsx-chai
preact-jsx-chai copied to clipboard
jsx render issue
hi @developit , I wrote a simple example, but it didn't run as expect.
function Cmp() {
return <div>cmp</div>
}
class Test extends Component {
render() {
return (
<div><Cmp/></div>
);
}
}
describe('Preact Test', function() {
it('<Test/>', function() {
expect(<Test />).to.deep.equal(<div><div>cmp</div></div>);
});
});
the error message is

Preact Test
✗ <Test/>
AssertionError: expected '<div>\n <Cmp></Cmp>\n</div>' to equal '<div>\n <div>cmp</div>\n</div>'
Chrome 55.0.2883 (Mac OS X 10.11.4) Preact Test <Test/> FAILED
AssertionError: expected '<div>\n <Cmp></Cmp>\n</div>' to equal '<div>\n <div>cmp</div>\n</div>'
Chrome 55.0.2883 (Mac OS X 10.11.4): Executed 1 of 1 (1 FAILED) ERROR (1.362 secs / 0.005 secs)
Hmm - that is very strange.