Skip to content

Instantly share code, notes, and snippets.

@cimfalab
Created July 19, 2017 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cimfalab/d584feafc4fa83cc51be3c9154706b8d to your computer and use it in GitHub Desktop.
Save cimfalab/d584feafc4fa83cc51be3c9154706b8d to your computer and use it in GitHub Desktop.
__tests__/ReactDOMComponent-test.js
it('should report component containing invalid styles', () => {
class Animal extends React.Component {
render() {
return <div style={1} />;
}
}
expect(function() {
ReactDOM.render(<Animal />, container);
}).toThrowError(
'The `style` prop expects a mapping from style properties to values, ' +
"not a string. For example, style= " +
'when using JSX.\n\nThis DOM node was rendered by `Animal`.',
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment