jest-puppe-shots-env
v0.7.0
Published
A Jest plugin for creating screenshots of React components with a help of Puppeteer
Downloads
12
Maintainers
Readme
jest-puppe-shots-env
A Jest plugin for creating screenshots of React components with a little help of Puppeteer
How it works?
This is the custom Jest Test Environment,
Global Teardown and
Global Setup hooks for the
jest-puppe-shots
package.
Check the README to get more information how to use the plugin.
Installation
You can install the plugin using NPM:
npm install jest-puppe-shots-env --save-dev
or by Yarn:
yarn add jest-puppe-shots-env --dev
Jest Configuration
Before starting using the jest-puppe-shots-env
you will need to change your Jest configuration file.
Open the jest.config.json file and add additional entries:
{
"testEnvironment": "jest-puppe-shots-env/lib/node-environment.js",
"globalSetup": "jest-puppe-shots-env/lib/global-setup.js",
"globalTeardown": "jest-puppe-shots-env/lib/global-teardown.js"
}
Those hooks are responsible for launching the Puppeteer in the background while the Jest runner is starting.