From 824cb58ceae45849c71f35696a240867db9e17fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Berg=C3=A9?= Date: Sun, 4 Mar 2018 20:53:58 +0100 Subject: [PATCH] docs: mention Jest Puppeteer Preset --- CHANGELOG.md | 2 ++ docs/Puppeteer.md | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 226c9f3d4268..63dc14f6f054 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,8 @@ ([#5648](https://github.com/facebook/jest/pull/5708)) * `[docs]` Add docs on using `jest.mock(...)` ([#5648](https://github.com/facebook/jest/pull/5648)) +* `[docs]` Mention Jest Puppeteer Preset + ([#5722](https://github.com/facebook/jest/pull/5722)) ## 22.4.2 diff --git a/docs/Puppeteer.md b/docs/Puppeteer.md index 1780ba4f8a6c..f38b0427b7dd 100644 --- a/docs/Puppeteer.md +++ b/docs/Puppeteer.md @@ -7,7 +7,28 @@ With the [Global Setup/Teardown](Configuration.md#globalsetup-string) and [Async Test Environment](Configuration.md#testenvironment-string) APIs, Jest can work smoothly with [puppeteer](https://github.com/GoogleChrome/puppeteer). -## A jest-puppeteer example +## Use Puppeteer Preset + +[Jest Puppeteer Preset](https://github.com/smooth-code/jest-puppeteer) provides +all required configuration to run your tests using Puppeteer. + +1. First install `jest-puppeteer-preset` + +``` +yarn add --dev jest-puppeteer-preset +``` + +2. Specify preset in your Jest configuration: + +```json +{ + "preset": "jest-puppeteer-preset" +} +``` + +See [documentation](https://github.com/smooth-code/jest-puppeteer). + +## Custom example The basic idea is to: