1.0.0 • Published 6 years ago

@mt-testutils/expect-shallow-snapshot v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

expect-shallow-snapshot

This is a convencience function for shallow-rendering a React component and asserting that it matches a Jest snapshot.

Shallow rendering means that nested components are not actually rendered, but show up in the snapshots as React components.

Installation

npm install --save-dev @mt-testutils/expect-shallow-snapshot

Usage

import MyReactComponent from './MyReactComponent';
import expectShallowSnapshot from '@mt-testutils/expect-shallow-snapshot';

describe('My react component', () => 
    it('renders correctly', () => expectShallowSnapshot(<MyComponent />)
);

Change Log

Contribution Guidelines

License

MIT licensed

Copyright © 2018 mobile.de GmbH