1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-jest-react-testing-library/__tests__/index.test.js

23 lines
512 B
JavaScript
Raw Normal View History

/* eslint-env jest */
import React from 'react'
import { render } from 'react-testing-library'
import App from '../pages/index.js'
describe('With React Testing Library', () => {
it('Shows "Hello world!"', () => {
const { getByText } = render(<App />)
expect(getByText('Hello World!')).not.toBeNull()
})
})
describe('With React Testing Library Snapshot', () => {
it('Should match Snapshot', () => {
const { asFragment } = render(<App />)
expect(asFragment()).toMatchSnapshot()
})
})