0.7.0 • Published 6 years ago

jest-puppe-shots-env v0.7.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

jest-puppe-shots-env

NPM version node Build Status dependencies Status devDependencies Status peerDependencies Status

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.