Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsx render issue #42

Open
walkdoer opened this issue Apr 14, 2017 · 1 comment
Open

jsx render issue #42

walkdoer opened this issue Apr 14, 2017 · 1 comment

Comments

@walkdoer
Copy link

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)
@developit
Copy link
Owner

Hmm - that is very strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants