├ Button/
├── __tests__/
| | ├── __snapshots__
| | | ├── index.js.snap // <- Button snapshot
| └── index.js // <- Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<A | |
href="https://example.com" | |
modifiers={['darkGreyText', 'uppercase']} | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Card from './blocks/Card'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone git@github.com:alanbsmith/jest-snapshot-example.git | |
$ cd jest-snapshot-example | |
$ yarn install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ yarn lint:js | |
$ yarn lint:js:watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Button from '../index'; | |
import renderer from 'react-test-renderer'; | |
describe('Button Block', () => { | |
it('renders correctly', () => { | |
const tree = renderer | |
.create(<Button>Submit</Button>) | |
.toJSON(); | |
expect(tree).toMatchSnapshot(); |
├ lib/
├── blocks/
| ├── Button/
| | ├── __tests__/
| | | ├── Icon.js // <- Element Test
| | | └── index.js // <- Block Test
| | ├── Icon.js // <- Element
| | ├── Text.js // <- Element
| | └── index.js // <- Block