-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kent C. Dodds
committed
Jun 26, 2018
1 parent
57db8dc
commit ad467ae
Showing
3 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import {render} from 'react-testing-library' | ||
import App from './App' | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div') | ||
ReactDOM.render(<App />, div) | ||
ReactDOM.unmountComponentAtNode(div) | ||
const {getByText} = render(<App />) | ||
expect(getByText('Learn React')).toBeInTheDOM() | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// react-testing-library renders your components to document.body, | ||
// this will ensure they're removed after each test. | ||
import 'react-testing-library/cleanup-after-each' | ||
|
||
// this adds jest-dom's custom assertions | ||
import 'jest-dom/extend-expect' |