Added Example Component and testing framework

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
2020-03-31 11:14:25 +02:00
parent 31692dfbd4
commit f5cdda822c
8 changed files with 94 additions and 30 deletions

View File

@ -0,0 +1,14 @@
import React from 'react'
import renderer from 'react-test-renderer'
import HelloWorld from '../../components/HelloWorld'
/**
* Example Test
*
* on first run it will generate a .snap file and after will compare result with it
*/
it('render a h1', () => {
const tree = renderer.create((<HelloWorld>Test</HelloWorld>)).toJSON()
expect(tree).toMatchSnapshot()
})

View File

@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`render a h1 1`] = `
<h1
className="jsx-3954099876"
>
Test
</h1>
`;