1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

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

This commit is contained in:
Niklas Wagner 2019-01-02 16:28:40 +01:00 committed by Tim Neutkens
parent fd3cb2a190
commit 85fd832ed8
3 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,11 @@
// 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>
`;

View file

@ -12,3 +12,11 @@ describe('With React Testing Library', () => {
expect(getByText('Hello World!')).not.toBeNull()
})
})
describe('With React Testing Library Snapshot', () => {
it('Should match Snapshot', () => {
const { asFragment } = render(<App />)
expect(asFragment()).toMatchSnapshot()
})
})

View file

@ -7,6 +7,9 @@
"react-dom": "latest"
},
"devDependencies": {
"@babel/core": "^7.1.2",
"babel-core": "^7.0.0-bridge",
"babel-jest": "^23.6.0",
"react-testing-library": "^5.4.2",
"jest": "^23.6.0"
},