Commit 85fd832e authored by Niklas Wagner's avatar Niklas Wagner Committed by Tim Neutkens

Fix rtl-test example & add Snapshot testing (#5981)

parent fd3cb2a1
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`With React Testing Library Snapshot Should match Snapshot 1`] = `
<DocumentFragment>
<div>
<p>
Hello World!
</p>
</div>
</DocumentFragment>
`;
...@@ -12,3 +12,11 @@ describe('With React Testing Library', () => { ...@@ -12,3 +12,11 @@ describe('With React Testing Library', () => {
expect(getByText('Hello World!')).not.toBeNull() expect(getByText('Hello World!')).not.toBeNull()
}) })
}) })
describe('With React Testing Library Snapshot', () => {
it('Should match Snapshot', () => {
const { asFragment } = render(<App />)
expect(asFragment()).toMatchSnapshot()
})
})
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
"react-dom": "latest" "react-dom": "latest"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.1.2",
"babel-core": "^7.0.0-bridge",
"babel-jest": "^23.6.0",
"react-testing-library": "^5.4.2", "react-testing-library": "^5.4.2",
"jest": "^23.6.0" "jest": "^23.6.0"
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment