Skip to content

Latest commit

 

History

History
33 lines (19 loc) · 831 Bytes

File metadata and controls

33 lines (19 loc) · 831 Bytes

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