Component Image
Generate image snapshots of React components for visual regression testing.
This package will only give you the image, you'll have to diff it with something else (like jest-image-snapshot
).
Usage
Install
npm install component-image
Use
; ;
Default options
options = // Path to .css file stylesheet: undefined; // Change size of screenshot viewport: width: 800 height: 600 renderer: ReactDOMServerrenderToStaticMarkup image: // Path to save image, likely unnecessary path: undefined // Options that are passed to Puppeteer puppeteerOptions: {}
Integration Example
Usage with jest-image-snapshot
:
; const component = <div> <h1>The Component</h1> </div>;