提交 85fd832e 编写于 作者: N Niklas Wagner 提交者: Tim Neutkens

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

上级 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', () => {
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 @@
"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"
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册