1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-20 09:58:13 +09:00

test: setup

This commit is contained in:
2019-08-03 00:35:23 +09:00
parent 48271c4ba2
commit 97ef88b8e4
6 changed files with 122 additions and 18 deletions

View File

@@ -1,9 +1,8 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { render } from '@testing-library/react'
import App from './App'
it('renders without crashing', () => {
const div = document.createElement('div')
ReactDOM.render(<App />, div)
ReactDOM.unmountComponentAtNode(div)
it('renders welcome message', () => {
const { getByText } = render(<App />)
expect(getByText('name new project')).toBeInTheDocument()
})

5
web/src/setupTests.js Normal file
View File

@@ -0,0 +1,5 @@
// react-testing-library renders your components to document.body,
// this will ensure they're removed after each test.
import '@testing-library/react/cleanup-after-each'
// this adds jest-dom's custom assertions
import '@testing-library/jest-dom/extend-expect'