Skip to content

Instantly share code, notes, and snippets.

@ernestofreyreg
Created December 24, 2019 16:23
Show Gist options
  • Save ernestofreyreg/138e823b40082a332702bbfbe457c8d4 to your computer and use it in GitHub Desktop.
Save ernestofreyreg/138e823b40082a332702bbfbe457c8d4 to your computer and use it in GitHub Desktop.
import * as React from 'react'
import { render } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import { MyComponent } from '../../index'
test('Renders', async () => {
const { getByRole } = render(<MyComponent />)
expect(getByRole('heading')).toHaveTextContent('My First Component')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment