Overview:
The react-screenshot-test package is no longer actively maintained. There is an alternative package called @previewjs/screenshot. This package allows for creating screenshot tests of React components. It utilizes Puppeteer to render and capture screenshots of components. It also provides cross-platform consistency by defaulting to running Puppeteer inside Docker. It supports various CSS techniques including CSS-in-JS libraries like Emotion and Styled Components.
Features:
- Capture screenshots of React components
- Cross-platform consistency with Docker and Puppeteer
- Support for CSS-in-JS libraries like Emotion and Styled Components
Installation:
To install the react-screenshot-test package, follow these steps:
Install the package:
npm install react-screenshot-test
Configure Jest by creating a
jest.screenshot.config.js
file:module.exports = { // Add Jest configuration options here };
Generate screenshots with the following command:
jest -c jest.screenshot.config.js -u
Summary:
The react-screenshot-test package allows for the creation of screenshot tests for React components. It utilizes Puppeteer and Docker to ensure cross-platform consistency. It also supports CSS-in-JS libraries like Emotion and Styled Components. However, please note that this package is no longer actively maintained and there is an alternative package called @previewjs/screenshot available.