Created
December 22, 2015 02:50
-
-
Save jamiebuilds/03d542c5de5e1f7e8a53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOMServer from 'react-dom/server'; | |
import assert from 'assert'; | |
function render(jsx) { | |
return ReactDOMServer.renderToStaticMarkup(jsx); | |
} | |
function assertEqual(actual, expected) { | |
assert.equal(render(actual), render(expected)); | |
} | |
class HelloWorld extends React.Component { | |
render() { | |
return <h1>Hello World</h1>; | |
} | |
} | |
suite('Tests', () => { | |
test('some dom', () => { | |
assertEqual( | |
<HelloWorld/>, | |
// should equal: | |
<h1>Hello World</h1> | |
); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment