mirror of
https://github.com/Aviortheking/next-template.git
synced 2025-07-23 22:09:50 +00:00
Added Example Component and testing framework
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
14
__tests__/components/HelloWorld.test.tsx
Normal file
14
__tests__/components/HelloWorld.test.tsx
Normal 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()
|
||||
})
|
@ -0,0 +1,9 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`render a h1 1`] = `
|
||||
<h1
|
||||
className="jsx-3954099876"
|
||||
>
|
||||
Test
|
||||
</h1>
|
||||
`;
|
Reference in New Issue
Block a user