Created
July 19, 2017 09:20
-
-
Save cimfalab/d584feafc4fa83cc51be3c9154706b8d to your computer and use it in GitHub Desktop.
__tests__/ReactDOMComponent-test.js
This file contains 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
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