Created
April 18, 2019 16:55
-
-
Save IsTheJack/d36119fb5ea9fc1ba4ed96c1cbe3531c to your computer and use it in GitHub Desktop.
Simple component test using Jest, React DOM and React
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
// This file should be named as Button.spec.tsx | |
import * as React from 'react' | |
import * as ReactDOM from 'react-dom' | |
import Button from './' | |
describe('component Button', () => { | |
it('renders without crashing', () => { | |
const div = document.createElement('div') | |
ReactDOM.render(<Button />, div) | |
ReactDOM.unmountComponentAtNode(div) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment