Created
February 12, 2020 23:58
-
-
Save ericdcobb/e68fefdb30ff3e8acd18edc33254d2ab 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 { render } from '@testing-library/react'; | |
import App from './App'; | |
jest.mock('./MyComponent', () => () => { | |
React.useEffect(() => { | |
console.log('using an effect'); | |
}); | |
return (<div>Hello World</div>); | |
}); | |
test('renders', () => { | |
const { container } = render(<App/>); | |
expect(container.textContent) | |
.toMatch('Hello World'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment