rsnext/examples/with-jest-react-testing-library/__tests__/index.test.js
2019-01-02 16:28:40 +01:00

22 lines
512 B
JavaScript

/* 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()
})
})