preact-jsx-chai icon indicating copy to clipboard operation
preact-jsx-chai copied to clipboard

jsx render issue

Open walkdoer opened this issue 8 years ago • 1 comments

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 image

  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)

walkdoer avatar Apr 14 '17 08:04 walkdoer

Hmm - that is very strange.

developit avatar Apr 15 '17 02:04 developit